0
I have for example two entities in my BD. Type_user and User. User receives a Typo_user FK from the Idtipousuario field. In my Domain(C#) I would have:
TipoUsuario
public int IDTipoUsuario { get; set; }
public string NmTipoUsuario { get; set; }
And in my user class I would have
Usuario
public int IdUsuario { get; set; }
public string NmUsuario { get; set; }
public virtual ICollection<int> IdTipoUsuario { get; set; }
I need also in the table of Tipousuario to do this
public virtual Usuario usuario { get; set; }
Just that is either enough to represent a foreign key (FK) in my class or I need to do more?
A user will have multiple types or a type will have multiple users? It seems that has a concept error.
– Jéf Bueno
User will have several types, so I made a user Icollection
– pnet
But one type (probably) may have more than one user.
– Jéf Bueno
@LINQ, yes, that’s right
– pnet
then on
TipoUsuario
you also have to have a Icollection]– Rovann Linhalis
@Rovannlinhalis, I just won’t need Icollection<> at one of the tips, when I have a 1:N, right? And where does the associative table enter? How do I represent it in my domain?
– pnet