-1

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?

Vlad
  • 3,001
  • 1
  • 22
  • 52

1 Answers1

0

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;
}
Vlad
  • 3,001
  • 1
  • 22
  • 52