Just getting my feet wet with some Fluent NHibernate AutoMap conventions, and ran into something I couldn\'t figure out. I assume I\'m just not looking in the right place...
You can override the auto-mapped properties as part of your AutoMap in Fluenttly.Configure().
So you can do this:
.Override(map => map.References(x => x.Group).Not.Nullable())
It's not exactly convenient if you have a lot of classes that need this though.
Edit: You can also specify the override in a class that implements IAutoMappingOverride like so:
public class JobMappingOverride : IAutoMappingOverride
{
public void Override(AutoMapping mapping)
{
mapping.References(x => x.Group).Not.Nullable();
}
}
and include it like so:
.UseOverridesFromAssemblyOf()
This would keep your fluent configuration a little cleaner.