1
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 model TipoFormulario
is Codigo
. So in the bank is generated TipoFormulario_Codigo
How can I define the name that will be generated ? I would like to name the column to TipoFormulario
Where’s the rest of the Model?
– Leonel Sanches da Silva
@Gypsy
– Rafael Barbosa
All right. Now put
TipoFormulario
too, please.– Leonel Sanches da Silva
Ready too !
– Rafael Barbosa