private EntityTypeMapping FindConditionTypeMapping( EntityType entityType, bool requiresSplit, EntityTypeMapping propertiesTypeMapping) { EntityTypeMapping typeMapping = propertiesTypeMapping; if (requiresSplit) { if (!entityType.Abstract) { typeMapping = propertiesTypeMapping.Clone(); typeMapping.RemoveIsOfType(typeMapping.EntityType); this._databaseMapping.GetEntitySetMappings().Single <EntitySetMapping>((Func <EntitySetMapping, bool>)(esm => esm.EntityTypeMappings.Contains(propertiesTypeMapping))).AddTypeMapping(typeMapping); } propertiesTypeMapping.MappingFragments.Each <MappingFragment>((Action <MappingFragment>)(tmf => tmf.ClearConditions())); } return(typeMapping); }
private EntityTypeMapping FindConditionTypeMapping( EntityType entityType, bool requiresSplit, EntityTypeMapping propertiesTypeMapping) { var conditionTypeMapping = propertiesTypeMapping; if (requiresSplit) { if (!entityType.Abstract) { conditionTypeMapping = propertiesTypeMapping.Clone(); conditionTypeMapping.RemoveIsOfType(conditionTypeMapping.EntityType); var parentEntitySetMapping = _databaseMapping.GetEntitySetMappings().Single( esm => esm.EntityTypeMappings.Contains(propertiesTypeMapping)); parentEntitySetMapping.AddTypeMapping(conditionTypeMapping); } propertiesTypeMapping.MappingFragments.Each(tmf => tmf.ClearConditions()); } return(conditionTypeMapping); }