1
I have my user using Asp.net Identity for authentication as usual I have my class implementing iuser
public class usuario: IUser
{
public User(){...}
public User(string userName) (){...}
public string Id { get; set; }
public string UserName { get; set; }
public string PasswordHash { get; set; }
}
Okay, I also have my class Person
Where all my registrations (customer, supplier, seller, etc.) inherit from Pessoa.
My question is:
It would be bad practice for me to implement the Iuser in a class of inherited person?
Public class usuario: Pessoa,IUser {
}
Or just have a class to connect both entities, thus doing PERSON Y has a user on the system
public class UsuarioPessoa {
public Pessoa Pessoa {get;set;}
public usuario usuario {get;set;}
}
At first a Seller who inherits from Person, will have a user to login to the system. and only 1.
In fact it depends on how you intend to implement these relationships, another idea (which I use) is to have an optional dependency on User Person, or vice versa:
public Pessoa Pessoa { get; set; }
. I would avoid the second example, because there may be cases of a Person having relations with one or more Users and also vice versa. Unless that is desirable.– iuristona