I'm working on a new asp.net mvc 5 app for a small company and am trying to figure out how to create the membership database using the new asp.net Identity system. I thought there might be an admin interface I can use which would create the database and allow me to add a few users/roles. Is there an admin interface for this task or another way I will need to accomplish it? Are there any tutorials on doing something like this? All I have been able to find so far has dealt with external logins using other providers such as Facebook or Google.
-
Are you looking for? aspnet_regsql.exe? Ref: msdn.microsoft.com/en-us/library/ms229862%28v=vs.80%29.aspxMister Epic– Mister Epic2013-10-22 15:15:07 +00:00Commented Oct 22, 2013 at 15:15
-
I'm honestly not sure, but I don't think so. I'm basically looking to populate the default localDB that came with the mvc 5 template connection string: <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-CompanyName-20131018042726.mdf;Initial Catalog=aspnet-CompanyName-20131018042726;Integrated Security=True" providerName="System.Data.SqlClient" />Jon– Jon2013-10-22 15:22:49 +00:00Commented Oct 22, 2013 at 15:22
2 Answers
I'm pretty sure that it's based off of Entity Framework Code First. When you create the db context, it should create the table for you automatically.
1 Comment
MVC 5 Template with VS2013 use ASP.NET Identity instead of membership provider and has no admin interface. After creating a new MVC5 project in VS2013, run the website. Once you register the first user on the web interface a local database will be created under the App_Data folder. You could rename the connection string to point to other database and register user again to create the database. To add users you could enable migration and use the seed method.
Scott Allen published a great video which might help you to understand ASP.NET Identity more http://pluralsight.com/training/courses/TableOfContents?courseName=aspdotnet-mvc5-fundamentals&highlight=scott-allen_aspdotnet-mvc5-fundamentals-m2-katana*8#aspdotnet-mvc5-fundamentals-m2-katana