I want to have two different mapping configurations. I need to somehow pass arguments to conventions so they can behave differently. Beside using lock
and static fields how can I do this?
I've found the solution: Conventions.Find
allows to find convention instances.
var map = AutoMap.AssemblyOf<AutomappingConfiguration>(new AutomappingConfiguration())
.Conventions.AddFromAssemblyOf<AutomappingConfiguration>()
.UseOverridesFromAssemblyOf<AutomappingConfiguration>();
foreach (var c in map.Conventions.Find<TableConvention>())
{
c.AllWritable = allWritable;
}