本文介绍了如何添加ASP.NET MVC5身份认证现有的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习MVC5身份认证和www.asp.net被阅读材料。
我有几个问题在这里。


  1. 如果我想使用身份认证,有没有理由不使用MVC模板?或者是有什么理由用空的模板? MVC模板还提供引导。


  2. 我有一个数据库中创建的,我想有一个DB率先发展。如果我使用MVC模板,凭据数据库将在项目文件夹下创建。我如何合并两个数据库,或者我应该只使用两个数据库?


如果我的问题是愚蠢的,只是不理我或者给先告诉我读什么。
我知道人们在社会上是好的,但关键。
谢谢


解决方案

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.

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.

这篇关于如何添加ASP.NET MVC5身份认证现有的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 07:01
查看更多