private static void LoadCustomMappings(IEnumerable<Type> types)
{
var maps =
types.SelectMany(t => t.GetInterfaces(), (t, i) => new { t, i })
.Where(
type =>
typeof(IHaveCustomMappings).IsAssignableFrom(type.t) && !type.t.IsAbstract &&
!type.t.IsInterface)
.Select(type => (IHaveCustomMappings)Activator.CreateInstance(type.t));
foreach (var map in maps)
{
map.CreateMappings(Mapper.Configuration);
}
}