I would like to know how to perform the modeling of a particular entity, where its reference value belongs to another table. This reference value would be a domain table that has its ID's for credit cards, since my user can register that their service accepts multiple credit card flags such as Visa, Master, etc.
Below is an example of my entities:
public class CartaoCreditoUsuario
{
public string Id { get; set; }
public int CartaoCreditoId { get; set; }
public virtual Usuario.Usuario Usuario { get; set; }
}
public class Usuario
{
public Usuario()
{
Id = Guid.NewGuid().ToString();
Enderecos = new List<Endereco>();
}
public string Id { get; set; }
public virtual string Email { get; set; }
public virtual bool ConfirmaçãoEmail{ get; set; }
public virtual ICollection<CartaoCreditoUsuario> CartaoCreditoUsuario { get; set; }
....
}
public class CartaoCredito
{
public int CartaoCreditoId { get; set; }
public string DescricaoCartaoCredito { get; set; }
}
I would like to know what my modelBuilder.Configurations
would look like for the entities mentioned above.
Thank you in advance.