private void ApplyInheritedTypeMap(TypeMap inheritedTypeMap)
{
foreach (var inheritedMappedProperty in inheritedTypeMap.GetPropertyMaps().Where(m => m.IsMapped()))
{
var conventionPropertyMap = GetPropertyMaps()
.SingleOrDefault(m =>
m.DestinationProperty.Name == inheritedMappedProperty.DestinationProperty.Name);
if (conventionPropertyMap != null)
{
conventionPropertyMap.ApplyInheritedPropertyMap(inheritedMappedProperty);
}
else
{
var propertyMap = new PropertyMap(inheritedMappedProperty, this);
_inheritedMaps.Add(propertyMap);
}
}
//Include BeforeMap
foreach (var beforeMapAction in inheritedTypeMap._beforeMapActions)
{
AddBeforeMapAction(beforeMapAction);
}
//Include AfterMap
foreach (var afterMapAction in inheritedTypeMap._afterMapActions)
{
AddAfterMapAction(afterMapAction);
}
}
}