Note that there are some explanatory texts on larger screens.

plurals
  1. POMove simple membership profider functionality to class library project
    primarykey
    data
    text
    <p>I'm trying to move my <code>DbSet</code>'s to a class library project that is going to be used for database operations.</p> <p>I've been following <a href="http://blog.longle.net/2012/09/25/seeding-users-and-roles-with-mvc4-simplemembershipprovider-simpleroleprovider-ef5-codefirst-and-custom-user-properties/" rel="nofollow">this</a> tutorial to a <code>Code First</code> / <code>SimpleMembershipProfider</code> project. I've already got the database filled with new tables etc, via the class lib project.</p> <p>But i am missing the webpages_ tables you can see on <a href="http://farm9.static.flickr.com/8455/7891461242_7cdaa6bd4a_b.jpg" rel="nofollow">this</a> image.</p> <p>This is my datacontext class:</p> <pre><code>public class DataContext : DbContext { public DataContext() : base("DefaultConnection") { } public DbSet&lt;Orders&gt; Orders { get; set; } public DbSet&lt;Appointment&gt; Appointment { get; set; } public DbSet&lt;UserProfile&gt; UserProfile { get; set; } } </code></pre> <p>And for every <code>DbSet</code> i created a cs file. I copied the <code>connectionString</code> from the <code>web.config</code> and placed it in the <code>app.config</code> in the class lib project. This is how the <code>app.config</code> file looks like:</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;/configSections&gt; &lt;connectionStrings&gt; &lt;add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=aspnet-CodeFirst-test;Integrated Security=SSPI;" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; &lt;system.web&gt; &lt;roleManager enabled="true" defaultProvider="SimpleRoleProvider"&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;membership defaultProvider="SimpleMembershipProvider"&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;/system.web&gt; &lt;entityFramework&gt; &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt; &lt;parameters&gt; &lt;parameter value="v11.0" /&gt; &lt;/parameters&gt; &lt;/defaultConnectionFactory&gt; &lt;/entityFramework&gt; &lt;/configuration&gt; </code></pre> <p>I'm not sure what to do with the Filters folder (which has the class <code>InitializeSimpleMembershipAttribute</code>) in my webproject.</p> <p>Can someone tell me how to get the <code>webpages_</code> created in the database? And how to move websecurity etc to the class lib project?</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload