Cannot use table 'AspNetUsers' in schema '' for entity 'AspNetUsers' since it is being used for another entity

后端 未结 2 1072
余生分开走
余生分开走 2021-01-21 15:29

We are trying to add Identity 3 to our existing Customers app by extending AspNetUsers

    public class ApplicationUser : IdentityUser
{
    public string Busine         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-21 16:16

    I suffered from the same problem using the following scenario:

    1. Scaffolding identity (code first)
    2. Update the same DB with identity tables using migrations (code first)
    3. Scaffold the DB context from the database. (db first)

    Currently I'm trying to use a separate DB for identity for the following gains:

    1. To keep Microsoft identity as a separate module so you can update it or remove it easily from your application.
    2. To create a single sign on architecture between multiple applications.
    3. To keep the application context flexible for both ways, i.e. DB-first or Code-first at any time.

    The challenge now is to use the two databases together at the data tier of the application.

提交回复
热议问题