I have a question about using PrimaryKeyNamingConvention Assume 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>(); });
Can you use something like the one described above? When you try to execute an error occurs
The 'banco' object does not have an identifier. Use the Id method to match your ID. For example: Id (x => x.Id).
source share