How best to represent a FK in the domain

0

I have for example two entities in my DB. User_Type and User. User receives an FK of User_Type from the UserType field. In my Domain (C #) I would have:

TipoUsuario
public int IDTipoUsuario { get; set; }
public string NmTipoUsuario { get; set; }

And in my user class would have

Usuario
public int IdUsuario { get; set; }
public string NmUsuario { get; set; }
public virtual ICollection<int> IdTipoUsuario { get; set; }

I also need in the UserType table to do this

public virtual Usuario usuario { get; set; }

Is this just enough to represent a foreign key (FK) in my class or do I need to do more?

    
asked by anonymous 22.11.2017 / 21:05

0 answers