Can Fluent NHibernate be configured to use an arbitrary prefix on a property backing field?
- by dommer
I'm currently using a convention to (auto)map collection properties to backing fields in Fluent NHibernate. So, I map a property "Orders" to a field "_orders". The convention I'm using to do this is:
public class HasManyAccessConvention : IHasManyConvention
{
public void Apply(IOneToManyCollectionInstance instance)
{
instance.Access.CamelCaseField(CamelCasePrefix.Underscore);
}
}
Can I write a convention that maps a (collection) property to a field with a non-standard prefix (ignoring whether this is good coding practice for the present)? So, the property "Orders" would be mapped to "xyz_orders", for example.
If so, how would I go about this?