我正在学习 MVC5 身份认证,正在阅读 www.asp 上的资料.我在这里有几个问题.
I am learning MVC5 identity authentication and was reading materials on www.asp. I have a few questions here.
如果我想使用身份认证,有没有理由不使用MVC模板?还是有理由使用空模板?MVC 模板还提供引导程序.
If I want to use identity authentication, is there a reason not to use MVC template? Or is there a reason to use empty template? MVC template also provides bootstrap.
我创建了一个数据库,我想先开发一个数据库.如果我使用 MVC 模板,将在项目文件夹下创建凭据数据库.如何合并两个数据库,或者我应该只使用两个数据库?
I have a database created, I want to have a DB first development. If I use the MVC template, the database for credentials will be created under the project folder. How can I merge the two database or I should just use two databases?
如果我的问题很愚蠢,请忽略我或告诉我先阅读什么.我知道社区里的人很好,但也很挑剔.谢谢
If my question is silly, just ignore me or give tell me what to read first. I know people in the community are good but critical. Thank you
推荐答案1) 如果我要使用身份认证,有没有理由不使用MVC 模板?还是有理由使用空模板?MVC模板还提供引导程序.
1) If I want to use identity authentication, is there a reason not to use MVC template? Or is there a reason to use empty template? MVC template also provides bootstrap.
身份验证、MVC 模板和引导程序实际上并不相关.
Identity authentication, MVC template and bootstrap are not really related.
如果您创建新的 MVC 5 应用程序,则会为您创建 AccountController.您可以使用该 AccountController 作为起点.
If you create new MVC 5 application, AccountController is created for you. You can use that AccountController as starting point.
如果需要,您可以删除 AccountController 并自己创建一个,但工作量很大.
If you want, you can delete the AccountController and create one yourself, but it is a lot of work.
2) 我创建了一个数据库,我想先开发一个数据库.如果我使用 MVC 模板,将创建凭据数据库在项目文件夹下.我怎样才能合并两个数据库或者我应该只用两个数据库?
2) I have a database created, I want to have a DB first development. If I use the MVC template, the database for credentials will be created under the project folder. How can I merge the two database or I should just use two databases?
您不需要两个数据库 - 您可以将身份表和自定义表放在同一个数据库中.
You do not need two databases - you can place Identity tables and your custom tables in same database.
从身份开始 - 让它创建数据库及其所需的表.然后您可以向该身份数据库添加自定义表.
Start with Identity - let it creates database and its required tables. Then you can add custom tables to that Identity database.
或者
如果您已经有带有连接字符串的数据库,您可以在以下位置更改身份连接名称.Identity 将在现有数据库中创建它的表.
If you already have database with connection string, you can change the Identity connection name at the following place. Identity will create its tables inside that existing database.
更多推荐
如何将 ASP.NET MVC5 身份验证添加到现有数据库
发布评论