Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public enum TipoContato
  2. {
  3. Telefone,
  4. Celular,
  5. Email
  6. }
  7.  
  8. public class Contato
  9. {
  10. public int Id { get; set; }
  11. public TipoContato Tipo { get; set; }
  12. public string Valor { get; set; }
  13. }
  14.  
  15. public class Pessoa
  16. {
  17. public int Id { get; set; }
  18. public string Nome { get; set; }
  19. public IList<Contato> Contatos { get; set; }
  20.  
  21. public Pessoa()
  22. {
  23. Contatos = new List<Contato>();
  24. }
  25. }
  26.  
  27. @Html.DropDownListFor(c => c.Contatos[0].Tipo, new SelectList(Enum.GetValues(typeof(TesteWeb.Models.TipoContato))))
  28. @Html.EditorFor(c => c.Contatos[0].Valor)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement