6
I have a DTO class
[Serializable]
public class PerfilDTO
{
public int Codigo { get; set; }
public string Descricao { get; set; }
public SituacaoEnum Situacao { get; set; }
public List<PerfilFuncionalidadeDTO> PerfilFuncionalidade { get; set; }
}
And in that DTO I have mine SituacaoEnum
which is the below:
public enum SituacaoEnum
{
[Description("Ativo")]
Ativo = 1,
[Description("Inativo")]
Inativo = 2
}
In my view I have the following:
@model IEnumerable<ControleAcesso.PerfilDTO>
any html and:
@Html.DropDownListFor(this.Model.First().Situacao)
How to dropdown from what I have?
which necessarily
dtos => dtos.First().Situacao
do? I put in mine by asking in the parameter but did not understand the pq rs– okevinlira
It indicates which parameter will be filled in. In this case, the field
Situacao
of the first record ofdtos
. I don’t think that’s the right approach, but it doesn’t get in the way of the answer.– Leonel Sanches da Silva
It’s... something tells me I’m going to get a 5 minute stop clock spanking from Asp-net mvc yet. rs. In fact it works perfectly. Thank you!
– okevinlira