I am learning MVC5 identity authentication and was reading materials on www.asp.net. I have a few questions here.

  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.

  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?

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) 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.

Identity authentication, MVC template and bootstrap are not really related.

If you create new MVC 5 application, AccountController is created for you. You can use that AccountController as starting point.

If you want, you can delete the AccountController and create one yourself, but it is a lot of work.

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.

Or

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.

enter image description here

Asp.net相关问答推荐

有人可以解释一下这个Eager 加载示例吗?

分层架构中的 ASP.NET 和实体框架 - 仅将实体框架用于 ORM

在每个对象上设置 ClientIDMode = Static 是否有任何缺点(在母版页的 maincontent 上设置)

如何在 C# 中生成一个随机的 10 位数字?

EntityFramework 通过 ID 获取对象?

模型项的类型为 CookMeIndexViewModel,但需要类型为 IEnumerable 的模型项

获取在 asp.net identity 2.0 中分配了角色的用户列表

无法访问,内部,资源文件?

无法加载文件或程序集 'System.Web.Mvc,版本 = 3.0.0.0,Elmah.MVC 问题

如何从 asp:Repeater 循环遍历项目模板中的项目?

无法确定条件表达式的类型,因为 'string' 和 'System.DBNull' 之间没有隐式转换

Razor 主机工厂错误

如何使用 asp.net 获取 html Select 的选定值

您如何在 .net WebApi2 应用程序中的 OAuth2 令牌请求中使用额外参数

Html.RenderAction 和 Html.Action 的区别

头标记中的内联代码 - ASP.NET

协调 ASP.NET 脚本包和源映射

避免在 ASP.NET MVC 中使用会话状态是一种好习惯吗?如果是,为什么以及如何?

~/ 等价于 javascript

解耦 ASP.NET MVC 5 标识以允许实现分层应用程序