One to Many Relationship

Aug 16 2020 9:16 AM
Good afternoon, I am new in asp net. I am building some System EPI Management . I dont know how i could do what i want, I have a Product class with those atributes
  1. public class Produto  
  2. {  
  3. [Key]  
  4. public int ProdutoID { getset; }  
  5. public string Nome { getset; }  
  6. [Display(Name ="Descricao")]  
  7. public string Desc { getset; }  
  8. public int FornecedorID { getset; }  
  9. public virtual Fornecedor Fornecedor { getset; }  
  10. public int CategoriaID { getset; }  
  11. public virtual Categoria Categoria { getset; }  
  12. public string Armazem { getset; }  
  13. [Display(Name ="Unidades Metricas")]  
  14. public int UnitMID { getset; }  
  15. public virtual UnitM UnitM { getset; }  
  16. }  
and I have a Employee Class too, Iam using Code First. And i do have a Entrada Class is a ReceiveGoods class
  1. public class Entrada  
  2. {  
  3. [Key]  
  4. public int EntradaID { getset; }  
  5. public string MotivoEntrada { getset; }  
  6. public string Nota { getset; }  
  7. public int GetIDFuncionario { get; }  
  8. public IEnumerable<Produto> Produto { getset; }  
  9. }  
In the class Entrada i want to select more than one pruduct. i dont know how to to. I tried Dropdownlist is keep showing me error. help me, the need is to add many products as possible.

Brought to you by:

Answers (1)