I have the following code in my model SubGrupo
:
namespace Aplicacao.Core.Dominio
{
public class SubGrupo
{
[Key]
public int Codigo { get; set; }
[Required(ErrorMessage = "Campo Obrigatório.")]
public string Descricao { get; set; }
public virtual TipoFormulario TipoFormulario { get; set; }
}
}
Model TipoFormulario
namespace Aplicacao.Core.Dominio
{
public class TipoFormulario
{
[Key]
public int Codigo { get; set; }
[Required(ErrorMessage = "Campo Obrigatório.")]
public string Descricao { get; set; }
}
}
In this case, the Key
of the TipoFormulario
model is Codigo
. So in the database is generated TipoFormulario_Codigo
How can I set the name to be generated? I would like to name the column for TipoFormulario