internal ConventionNavigationPropertyConfiguration( NavigationPropertyConfiguration configuration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { this._configuration = configuration; this._modelConfiguration = modelConfiguration; }
internal ConventionTypeConfiguration( Type type, Func <ComplexTypeConfiguration> complexTypeConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) : this(type, (Func <EntityTypeConfiguration>)null, complexTypeConfiguration, modelConfiguration) { }
internal ConventionTypeConfiguration( Type type, Func <ComplexTypeConfiguration> complexTypeConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { this._configuration = new ConventionTypeConfiguration(type, complexTypeConfiguration, modelConfiguration); }
private ModelConfiguration(System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration source) { source._entityConfigurations.Each <KeyValuePair <Type, EntityTypeConfiguration> >((Action <KeyValuePair <Type, EntityTypeConfiguration> >)(c => this._entityConfigurations.Add(c.Key, c.Value.Clone()))); source._complexTypeConfigurations.Each <KeyValuePair <Type, ComplexTypeConfiguration> >((Action <KeyValuePair <Type, ComplexTypeConfiguration> >)(c => this._complexTypeConfigurations.Add(c.Key, c.Value.Clone()))); this._ignoredTypes.AddRange <Type>((IEnumerable <Type>)source._ignoredTypes); this.DefaultSchema = source.DefaultSchema; this.ModelNamespace = source.ModelNamespace; }
public void Apply(Type memberInfo, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { if (!this._predicates.All <Func <Type, bool> >((Func <Func <Type, bool>, bool>)(p => p(memberInfo)))) { return; } this.ApplyCore(memberInfo, modelConfiguration); }
internal virtual void ApplyModelConfiguration(Type type, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { for (int index = this._configurationConventions.Count - 1; index >= 0; --index) { IConvention configurationConvention = this._configurationConventions[index]; (configurationConvention as IConfigurationConvention <Type>)?.Apply(type, modelConfiguration); (configurationConvention as Convention)?.ApplyModelConfiguration(type, modelConfiguration); } }
protected override void ApplyCore(Type memberInfo, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { T obj = this._capturingPredicate(memberInfo); if ((object)obj == null) { return; } this.InvokeAction(memberInfo, modelConfiguration, obj); }
internal virtual void ApplyPropertyConfiguration( PropertyInfo propertyInfo, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { for (int index = this._configurationConventions.Count - 1; index >= 0; --index) { IConvention configurationConvention = this._configurationConventions[index]; (configurationConvention as IConfigurationConvention <PropertyInfo>)?.Apply(propertyInfo, modelConfiguration); (configurationConvention as Convention)?.ApplyPropertyConfiguration(propertyInfo, modelConfiguration); } }
private ConventionTypeConfiguration( Type type, Func <EntityTypeConfiguration> entityTypeConfiguration, Func <ComplexTypeConfiguration> complexTypeConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { this._type = type; this._entityTypeConfiguration = entityTypeConfiguration; this._complexTypeConfiguration = complexTypeConfiguration; this._modelConfiguration = modelConfiguration; }
public void Apply( PropertyInfo memberInfo, Func <System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration> configuration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { if (!this._predicates.All <Func <PropertyInfo, bool> >((Func <Func <PropertyInfo, bool>, bool>)(p => p(memberInfo)))) { return; } this.ApplyCore(memberInfo, configuration, modelConfiguration); }
internal virtual void ApplyPropertyConfiguration( PropertyInfo propertyInfo, Func <PropertyConfiguration> propertyConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { Type configurationType = StructuralTypeConfiguration.GetPropertyConfigurationType(propertyInfo.PropertyType); for (int index = this._configurationConventions.Count - 1; index >= 0; --index) { IConvention configurationConvention = this._configurationConventions[index]; new ConventionsConfiguration.PropertyConfigurationConventionDispatcher(configurationConvention, configurationType, propertyInfo, propertyConfiguration, modelConfiguration).Dispatch(); (configurationConvention as Convention)?.ApplyPropertyConfiguration(propertyInfo, propertyConfiguration, modelConfiguration); } }
internal virtual void ApplyPropertyTypeConfiguration <TStructuralTypeConfiguration>( PropertyInfo propertyInfo, Func <TStructuralTypeConfiguration> structuralTypeConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) where TStructuralTypeConfiguration : StructuralTypeConfiguration { for (int index = this._configurationConventions.Count - 1; index >= 0; --index) { IConvention configurationConvention = this._configurationConventions[index]; (configurationConvention as IConfigurationConvention <PropertyInfo, TStructuralTypeConfiguration>)?.Apply(propertyInfo, structuralTypeConfiguration, modelConfiguration); (configurationConvention as IConfigurationConvention <PropertyInfo, StructuralTypeConfiguration>)?.Apply(propertyInfo, (Func <StructuralTypeConfiguration>)structuralTypeConfiguration, modelConfiguration); (configurationConvention as Convention)?.ApplyPropertyTypeConfiguration <TStructuralTypeConfiguration>(propertyInfo, structuralTypeConfiguration, modelConfiguration); } }
public virtual void AddConfigurationTypesToModel( IEnumerable <Type> types, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { foreach (Type type in types) { if (this._filter.IsEntityTypeConfiguration(type)) { modelConfiguration.Add(this._activator.Activate <EntityTypeConfiguration>(type)); } else if (this._filter.IsComplexTypeConfiguration(type)) { modelConfiguration.Add(this._activator.Activate <ComplexTypeConfiguration>(type)); } } }
internal override void ApplyPropertyTypeConfiguration <TStructuralTypeConfiguration>( PropertyInfo propertyInfo, Func <TStructuralTypeConfiguration> structuralTypeConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { if (!(typeof(TStructuralTypeConfiguration) == typeof(EntityTypeConfiguration)) || !this._attributeProvider.GetAttributes(propertyInfo).OfType <KeyAttribute>().Any <KeyAttribute>()) { return; } EntityTypeConfiguration typeConfiguration = (EntityTypeConfiguration)(object)structuralTypeConfiguration(); if (!propertyInfo.IsValidEdmScalarProperty()) { return; } typeConfiguration.Key(propertyInfo); }
internal override void ApplyPropertyConfiguration( PropertyInfo propertyInfo, Func <PropertyConfiguration> propertyConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { if (!propertyInfo.IsValidEdmNavigationProperty() || propertyInfo.PropertyType.IsCollection() || !this._attributeProvider.GetAttributes(propertyInfo).OfType <RequiredAttribute>().Any <RequiredAttribute>()) { return; } NavigationPropertyConfiguration propertyConfiguration1 = (NavigationPropertyConfiguration)propertyConfiguration(); if (propertyConfiguration1.RelationshipMultiplicity.HasValue) { return; } propertyConfiguration1.RelationshipMultiplicity = new RelationshipMultiplicity?(RelationshipMultiplicity.One); }
public PropertyConfigurationConventionDispatcher( IConvention convention, Type propertyConfigurationType, PropertyInfo propertyInfo, Func <PropertyConfiguration> propertyConfiguration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { Check.NotNull <IConvention>(convention, nameof(convention)); Check.NotNull <Type>(propertyConfigurationType, nameof(propertyConfigurationType)); Check.NotNull <PropertyInfo>(propertyInfo, nameof(propertyInfo)); Check.NotNull <Func <PropertyConfiguration> >(propertyConfiguration, nameof(propertyConfiguration)); this._convention = convention; this._propertyConfigurationType = propertyConfigurationType; this._propertyInfo = propertyInfo; this._propertyConfiguration = propertyConfiguration; this._modelConfiguration = modelConfiguration; }
internal ConfigurationRegistrar(System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { this._modelConfiguration = modelConfiguration; }
internal ConventionTypeConfiguration(Type type, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { this._configuration = new ConventionTypeConfiguration(type, modelConfiguration); }
internal virtual void Apply(System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { Check.NotNull <System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration>(modelConfiguration, nameof(modelConfiguration)); EdmMetadataContext.ConfigureEdmMetadata(modelConfiguration); }
public static void ConfigureEdmMetadata(System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { modelConfiguration.Entity(typeof(EdmMetadata)).ToTable("EdmMetadata"); }
internal override void ApplyModelConfiguration(System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration) { base.ApplyModelConfiguration(modelConfiguration); modelConfiguration.ModelNamespace = this._modelNamespace; }
protected abstract void InvokeAction( Type memberInfo, Func <ComplexTypeConfiguration> configuration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration, T value);
protected abstract void ApplyCore( Type memberInfo, Func <ComplexTypeConfiguration> configuration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration);
protected abstract void ApplyCore(Type memberInfo, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration);
protected abstract void ApplyCore( PropertyInfo memberInfo, Func <System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration> configuration, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration modelConfiguration);
protected abstract void InvokeAction( Type memberInfo, System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration configuration, T value);