All my tables have an integer column as an Id – Primary Key
Except one
instance.CustomType<int>();
instance.GeneratedBy.Custom<global::NHibernate.Id.IdentityGenerator>();
instance.UnsavedValue("0");
Is there a way to ignore the primary key convention for this one mapping file?
mapping.Id(a => a.Id, "RoleName").GeneratedBy.Assigned();
Thanks
You can override it. Although it looks like you are try to use a mixture of both Fluent NH Automapping and mapping by code which I’m not sure that it will work in this case. I would override it like this:
I took the basic idea from: https://github.com/jagregory/fluent-nhibernate/wiki/Auto-mapping