Asp.net Identity Good practice authorization

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 Person class

Where all my registrations (customer, vendor, vendor, etc.) inherit from Person.

My question is:

Would it be a bad practice for me to implement IUser in a person inherit class?

Public class usuario: Pessoa,IUser {
}

Or just have a class to connect both entities, doing so, the PERSON Y has a user in the system

public class UsuarioPessoa {

public Pessoa Pessoa {get;set;}
public usuario usuario {get;set;}
}

At first a Salesperson who inherits from Person, I will have a user to log in to the system. and only 1.

    
asked by anonymous 07.03.2014 / 20:39

1 answer

1

It depends on your goal.

I agree with Pessoa and Usuário to be separated if Pessoa does not need to have Usuário , or if Pessoa has multiple Usuários (2nd example).

Otherwise, it is best to implement everything in class Pessoa (1st example).

    
07.03.2014 / 20:51