当前位置: 首页>>代码示例>>C#>>正文


C# ConfigurationSource类代码示例

本文整理汇总了C#中ConfigurationSource的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationSource类的具体用法?C# ConfigurationSource怎么用?C# ConfigurationSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurationSource类属于命名空间,在下文中一共展示了ConfigurationSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RelationalEntityTypeBuilderAnnotations

 public RelationalEntityTypeBuilderAnnotations(
     [NotNull] InternalEntityTypeBuilder internalBuilder,
     ConfigurationSource configurationSource,
     [CanBeNull] string providerPrefix)
     : base(new RelationalAnnotationsBuilder(internalBuilder, configurationSource, providerPrefix))
 {
 }
开发者ID:491134648,项目名称:EntityFramework,代码行数:7,代码来源:RelationalEntityTypeBuilderAnnotations.cs

示例2: BuildUpConfiguration

 internal override ConfigurationSource BuildUpConfiguration(ConfigurationSource previousSource)
 {
     this.Populate(previousSource);
     this.FindSubscribers();
     this.FindMessageFilters();
     return this;
 }
开发者ID:WaveServiceBus,项目名称:WaveServiceBus,代码行数:7,代码来源:ReflectionConfigurationSource.cs

示例3: Annotation

        public virtual bool Annotation(
            [NotNull] string annotation, [CanBeNull] object value, ConfigurationSource configurationSource)
        {
            var existingValue = Metadata[annotation];
            if (existingValue != null)
            {
                ConfigurationSource existingConfigurationSource;
                if (!_annotationSources.Value.TryGetValue(annotation, out existingConfigurationSource))
                {
                    existingConfigurationSource = ConfigurationSource.Explicit;
                }

                if ((value == null || existingValue != value)
                    && !configurationSource.Overrides(existingConfigurationSource))
                {
                    return false;
                }

                configurationSource = configurationSource.Max(existingConfigurationSource);
            }

            if (value != null)
            {
                _annotationSources.Value[annotation] = configurationSource;
                Metadata[annotation] = value;
            }
            else
            {
                _annotationSources.Value.Remove(annotation);
                Metadata.RemoveAnnotation(new Annotation(annotation, "_"));
            }

            return true;
        }
开发者ID:rbenhassine2,项目名称:EntityFramework,代码行数:34,代码来源:InternalMetadataBuilder.cs

示例4: ForeignKey

        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public ForeignKey(
            [NotNull] IReadOnlyList<Property> dependentProperties,
            [NotNull] Key principalKey,
            [NotNull] EntityType dependentEntityType,
            [NotNull] EntityType principalEntityType,
            ConfigurationSource configurationSource)
        {
            Check.NotEmpty(dependentProperties, nameof(dependentProperties));
            Check.HasNoNulls(dependentProperties, nameof(dependentProperties));
            Check.NotNull(principalKey, nameof(principalKey));
            Check.NotNull(principalEntityType, nameof(principalEntityType));

            Properties = dependentProperties;
            PrincipalKey = principalKey;
            DeclaringEntityType = dependentEntityType;
            PrincipalEntityType = principalEntityType;
            _configurationSource = configurationSource;

            AreCompatible(principalKey.Properties, dependentProperties, principalEntityType, dependentEntityType, shouldThrow: true);

            if (!principalEntityType.GetKeys().Contains(principalKey))
            {
                throw new InvalidOperationException(
                    CoreStrings.ForeignKeyReferencedEntityKeyMismatch(
                        Property.Format(principalKey.Properties),
                        principalEntityType));
            }

            Builder = new InternalRelationshipBuilder(this, dependentEntityType.Model.Builder);
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:34,代码来源:ForeignKey.cs

示例5: Annotation

        private bool Annotation(
            string annotation, object value, ConfigurationSource configurationSource, bool canOverrideSameSource)
        {
            var existingValue = Metadata[annotation];
            if (existingValue != null)
            {
                ConfigurationSource existingConfigurationSource;
                if (!_annotationSources.Value.TryGetValue(annotation, out existingConfigurationSource))
                {
                    existingConfigurationSource = ConfigurationSource.Explicit;
                }

                if ((value == null || !existingValue.Equals(value))
                    && (!configurationSource.Overrides(existingConfigurationSource)
                    || configurationSource == existingConfigurationSource && !canOverrideSameSource))
                {
                    return false;
                }

                configurationSource = configurationSource.Max(existingConfigurationSource);
            }

            if (value != null)
            {
                _annotationSources.Value[annotation] = configurationSource;
                Metadata[annotation] = value;
            }
            else
            {
                _annotationSources.Value.Remove(annotation);
                Metadata.RemoveAnnotation(new Annotation(annotation, "_"));
            }

            return true;
        }
开发者ID:491134648,项目名称:EntityFramework,代码行数:35,代码来源:InternalMetadataBuilder.cs

示例6: RelationalForeignKeyBuilderAnnotations

 public RelationalForeignKeyBuilderAnnotations(
     [NotNull] InternalRelationshipBuilder internalBuilder,
     ConfigurationSource configurationSource,
     [CanBeNull] string providerPrefix)
     : base(new RelationalAnnotationsBuilder(internalBuilder, configurationSource, providerPrefix))
 {
 }
开发者ID:adwardliu,项目名称:EntityFramework,代码行数:7,代码来源:RelationalForeignKeyBuilderAnnotations.cs

示例7: Overrides

        public static bool Overrides(this ConfigurationSource newConfigurationSource, ConfigurationSource? oldConfigurationSource)
        {
            if (oldConfigurationSource == null)
            {
                return true;
            }

            if (newConfigurationSource == ConfigurationSource.Explicit)
            {
                return true;
            }

            if (oldConfigurationSource == ConfigurationSource.Explicit)
            {
                return false;
            }

            if (newConfigurationSource == ConfigurationSource.DataAnnotation)
            {
                return true;
            }

            if (oldConfigurationSource == ConfigurationSource.DataAnnotation)
            {
                return false;
            }

            return true;
        }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:29,代码来源:ConfigurationSourceExtensions.cs

示例8: RelationalEntityTypeBuilderAnnotations

 public RelationalEntityTypeBuilderAnnotations(
     [NotNull] InternalEntityTypeBuilder internalBuilder,
     ConfigurationSource configurationSource,
     [CanBeNull] RelationalFullAnnotationNames providerFullAnnotationNames)
     : base(new RelationalAnnotationsBuilder(internalBuilder, configurationSource), providerFullAnnotationNames)
 {
 }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:7,代码来源:RelationalEntityTypeBuilderAnnotations.cs

示例9: RelationalAnnotationsBuilder

        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public RelationalAnnotationsBuilder(
            [NotNull] InternalMetadataBuilder internalBuilder,
            ConfigurationSource configurationSource)
            : base(internalBuilder.Metadata)
        {
            Check.NotNull(internalBuilder, nameof(internalBuilder));

            MetadataBuilder = internalBuilder;
            ConfigurationSource = configurationSource;
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:14,代码来源:RelationalAnnotationsBuilder.cs

示例10: CanSetAnnotation

        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual bool CanSetAnnotation([NotNull] string name, [CanBeNull] object value, ConfigurationSource configurationSource)
        {
            var existingAnnotation = Metadata.FindAnnotation(name);
            if (existingAnnotation != null)
            {
                return CanSetAnnotationValue(existingAnnotation, value, configurationSource, canOverrideSameSource: true);
            }

            return true;
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:14,代码来源:InternalMetadataBuilder.cs

示例11: Max

        public static ConfigurationSource Max(this ConfigurationSource left, ConfigurationSource? right)
        {
            if (!right.HasValue
                || left.Overrides(right.Value))
            {
                return left;
            }

            return right.Value;
        }
开发者ID:adwardliu,项目名称:EntityFramework,代码行数:10,代码来源:ConfigurationSourceExtensions.cs

示例12: RelationalAnnotationsBuilder

        public RelationalAnnotationsBuilder(
            [NotNull] InternalMetadataBuilder internalBuilder,
            ConfigurationSource configurationSource,
            [CanBeNull] string providerPrefix)
            : base(internalBuilder.Metadata, providerPrefix)
        {
            Check.NotNull(internalBuilder, nameof(internalBuilder));

            EntityTypeBuilder = internalBuilder;
            ConfigurationSource = configurationSource;
        }
开发者ID:491134648,项目名称:EntityFramework,代码行数:11,代码来源:RelationalAnnotationsBuilder.cs

示例13: AddEntityType

        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual EntityType AddEntityType(
            [NotNull] string name,
            // ReSharper disable once MethodOverloadWithOptionalParameter
            ConfigurationSource configurationSource = ConfigurationSource.Explicit,
            bool runConventions = true)
        {
            Check.NotEmpty(name, nameof(name));

            var entityType = new EntityType(name, this, configurationSource);

            return AddEntityType(entityType, runConventions);
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:16,代码来源:Model.cs

示例14: Property

        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used 
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public Property(
            [NotNull] PropertyInfo propertyInfo,
            [NotNull] EntityType declaringEntityType,
            ConfigurationSource configurationSource)
            : base(Check.NotNull(propertyInfo, nameof(propertyInfo)).Name, propertyInfo)
        {
            Check.NotNull(declaringEntityType, nameof(declaringEntityType));

            DeclaringEntityType = declaringEntityType;
            ClrType = propertyInfo.PropertyType;
            Initialize(declaringEntityType, configurationSource);
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:16,代码来源:Property.cs

示例15: CombineParameters

        private static Dictionary<string, string> CombineParameters(ConfigurationSource source, string resource, Dictionary<string, string> parameters) {
            if (source == ConfigurationSource.Xml || resource.IndexOf('?') <= 0)
                return parameters;

            if (parameters == null) {
                parameters = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            }
            foreach (var pair in Common.ParseQueryString(resource.Substring(resource.IndexOf('?')))) {
                parameters[pair.Key] = pair.Value;
            }
            return parameters;
        }
开发者ID:mindis,项目名称:Transformalize,代码行数:12,代码来源:ProcessFactory.cs


注:本文中的ConfigurationSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。