private void ConfigureFunctionMappings(EdmModel model, EntityTypeConfiguration entityTypeConfiguration, EntityType entityType) { if (entityTypeConfiguration.ModificationStoredProceduresConfiguration == null) { return; } while (entityType.BaseType != null) { EntityTypeConfiguration baseTypeConfiguration; var baseClrType = ((EntityType)entityType.BaseType).GetClrType(); Debug.Assert(baseClrType != null); if (!entityType.BaseType.Abstract && (!_entityConfigurations .TryGetValue(baseClrType, out baseTypeConfiguration) || baseTypeConfiguration.ModificationStoredProceduresConfiguration == null)) { throw Error.BaseTypeNotMappedToFunctions( baseClrType.Name, entityTypeConfiguration.ClrType.Name); } entityType = (EntityType)entityType.BaseType; } // Propagate function mapping down hierarchy model.GetSelfAndAllDerivedTypes(entityType) .Each( e => { var entityConfiguration = Entity(e.GetClrType()); if (entityConfiguration.ModificationStoredProceduresConfiguration == null) { entityConfiguration.MapToStoredProcedures(); } }); }