We have an existing ASP.net Core 2.1 Application which has UserAccounts associated with the Identity-System.
Now we would like to add Admin-Users which shall not share the UserAccountsTable which is already used by the UserAccounts. (Yeah i know, we could simply add a bool column like isAdmin
but we opted for seperated tables).
So my thinking was, that i need to create a new Identity-Instance which is using our AdminUser
and AdminRole
classes (Both deriving from IdentityUser
and IdentityRole
accordingly).
In the DBContext i can now change the Table-Names via the Fluent-API of AdminUser
and AdminRole
. But how would i now change the names of the needed "infrastructure" tables created by Identity automatically?
I've found this documentation by Microsoft. But they are only using "generic" types to rename the tables for e.G. the Link-Table between Users and Roles (IdentityUserRole
). This type would probably "conflict" with my already configured UserAccounts-Identity, therefore "renaming" both tables, making troubles again, or not?
An obvious solution could be to create a new AdminUserContext
, which would not share the UserAccounts-Information. But then we would lose the Links to the Entities we actually would want to administrate? And linking DBContexts doesn't feel "right" to me.
Anybody got some ideas to this?