且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在现有数据库中创建 ASP.Net Identity 表?

更新时间:2023-02-03 16:57:49

是否将用户表添加到现有的 sql server 中,或者是这个用户数据库是一个完全独立的数据库?

Will there the user tables be added to the existing sql server, or is this user database a completely separate database?

您不需要两个数据库 - 您可以在现有数据库中创建身份表.

You do not need two databases - you can create Identity tables inside your existing database.

ASP.Net Identity 使用实体框架代码优先.因此,在第一次运行您的应用程序之前,您希望更新与通常位于 ApplicationDbContext 中的现有数据库相同的连接字符串.

ASP.Net Identity uses Entity Framework Code First. Therefore, before running your application first time, you want to update Connection String same as existing database which is normally inside ApplicationDbContext.

如果您已经有两个独立的数据库并希望合并它们,您需要使用 RedGate - SQL Compare 和 Data Compare 等工具.

If you already have two separate databases and want to merge them, you want to use tools such as RedGate - SQL Compare and Data Compare.

合并两个数据库完全不是最初的问题;如果您有问题,请创建一个单独的问题.

Merging two database is totally out of original question; please kindly create a separate question if you have one.