3
I want to use 2 classes as User in Identity and could not see this change in code.
Let’s assume that I will use the default class "Applicationuser" that generates an "Aspnetusers" table and I want to use another table "Clients" that inherits from Identity.
The Applicationuser class already inherits from Identity and works fine. I saw that there is a class Applicationusermanager and others that inherit from Applicationuser. Example:
public class ApplicationUser : IdentityUser
public class ApplicationUserManager : UserManager<ApplicationUser>
public class ApplicationSignInManager : SignInManager<ApplicationUser, string>
public class Cliente: IdentityUser
My question is whether I will need to create new classes to inherit from Client, example:
public class ApplicationUserManagerCliente : UserManager<Cliente>
public class ApplicationSignInManagerCliente : SignInManager<Cliente, string>
Would it be that or am I thinking wrong?
Why do you have to use 2 classes? Wouldn’t it be better to use only
Cliente
?– Leonel Sanches da Silva
It’s because I want to use a user class for access to the administrative area of the site. and another user class for external access. Got it?
– Gabriel Moura
@Gabrielmoura this is authorization, does not make sense 2 users, create 1 and authorization for the particular area that he can or will not access
– Rod