I have a question about using PrimaryKeyNamingConvention Suppose the following class:
public class banco
{
[Required]
public virtual int banco_id { get; set; }
...
}
and
public class PrimaryKeyNamingConvention : IIdConvention
{
public void Apply(IIdentityInstance instance)
{
instance.Column(instance.EntityType.Name + "_id");
}
}
and
static AutoPersistenceModel CreateAutomappings()
{
... Conventions.Setup(c =>
{
c.Add<PrimaryKeyNamingConvention>();
});
You can use something like described above? When I try to run an error occurs
The entity 'banco' doesn't have an Id mapped. Use the Id method to map your identity property. For example: Id(x => x.Id).