-2
Given the following scenario. I have 1 user table and a login table, for example. I need to create my domain class that maps these BD entities. In the login table, I get Idusuario. How it looks in my model this relationship?
[Table("Usuario")]
public class Usuario
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int IdUsuario { get; set; }
public string NMUsuario { get; set; }
public string Senha { get; set; }
}
[Table("Login")]
public class Login
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int IdLogin { get; set; }
public DateTime DtLogin { get; set; }
public virtual ICollection<Usuario> Usuarios { get; set; }?????????
}
Is that what I put, a Collection? And in the user table, only a virtual Idusuario?
Why do you need a collection of users? It’s not just a user who does the login? Or I didn’t understand what this table is?
– Maniero
@bigown, this, in reality did not know what to put and posted as an example just to know if this is it or not. Lost
– pnet