Asp.Net MVC 5 Identity Create Database Admin Interface

℡╲_俬逩灬. 提交于 2019-12-10 19:20:00

问题


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.


回答1:


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.

http://msdn.microsoft.com/en-us/data/jj193542.aspx




回答2:


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



来源:https://stackoverflow.com/questions/19521552/asp-net-mvc-5-identity-create-database-admin-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!