-5
I have this model
public class Funcionario
{
[Key]
public int id { get; set; }
[Required(ErrorMessage ="Nome do funcionário é obrigatório", AllowEmptyStrings =false)]
[Display(Name ="Nome")]
public String nome { get; set; }
[Required(ErrorMessage = "Data de Nascimento do funcionário é obrigatório", AllowEmptyStrings = false)]
[Display(Name = "Data de Nascimento")]
public DateTime dataNascimento { get; set; }
[Required(ErrorMessage = "CPF do funcionário é obrigatório", AllowEmptyStrings = false)]
[Display(Name = "CPF")]
public long cpf { get; set; }
[Required(ErrorMessage = "Cidade do funcionário é obrigatório", AllowEmptyStrings = false)]
[Display(Name = "Cidade")]
public virtual int cidade { get; set; }
}
and that other
public class Cidade
{
[Key]
public int id { get; set; }
[Required(ErrorMessage = "O nome da cidade é obrigatório", AllowEmptyStrings = false)]
[Display(Name="Nome")]
public String nome { get; set; }
}
Note that the Employee class receives City and I need to show the name of the city on the Grid and not just the code. Then I ask: Should I bring a City Survey in operation? And how does it look in the City model? a virtual int ????
When I posted, I’ve been downvoted without reading, how fast they are
– pnet
Dude, you have a lot of doubt about C# and ASP.NET MVC, and some basic questions, as they are often, I advise you to read books and see courses on technology, I’m sure you won’t have to waste time with this level of question.
– Gustavo Santos
I never know if these questions are serious or a kind of test when the user is a user with so many points of reputation
– Rodrigo Sidney
Even more so when the nickname and the main tag of the user indicate that it already uses a lot . net
– Rodrigo Sidney