如何将 ASP.NET MVC5 身份验证添加到现有数据库

编程入门 行业动态 更新时间:2024-10-24 04:50:40
本文介绍了如何将 ASP.NET MVC5 身份验证添加到现有数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在学习 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 身份验证添加到现有数据库

    本文发布于:2023-10-27 02:59:11,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1532109.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何将   身份验证   数据库   NET   ASP

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!