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


C# ConfigurationSource.Max方法代码示例

本文整理汇总了C#中ConfigurationSource.Max方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationSource.Max方法的具体用法?C# ConfigurationSource.Max怎么用?C# ConfigurationSource.Max使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigurationSource的用法示例。


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

示例1: 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

示例2: 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

示例3: UpdateIsStoreGeneratedAlwaysConfigurationSource

 private void UpdateIsStoreGeneratedAlwaysConfigurationSource(ConfigurationSource configurationSource)
     => _isStoreGeneratedAlwaysConfigurationSource = configurationSource.Max(_isStoreGeneratedAlwaysConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例4: UpdateIsUniqueConfigurationSource

 private void UpdateIsUniqueConfigurationSource(ConfigurationSource configurationSource)
     => _isUniqueConfigurationSource = configurationSource.Max(_isUniqueConfigurationSource);
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:2,代码来源:Index.cs

示例5: UpdateRequiresValueGeneratorConfigurationSource

 private void UpdateRequiresValueGeneratorConfigurationSource(ConfigurationSource configurationSource)
     => _requiresValueGeneratorConfigurationSource = configurationSource.Max(_requiresValueGeneratorConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例6: UpdateIsConcurrencyTokenConfigurationSource

 private void UpdateIsConcurrencyTokenConfigurationSource(ConfigurationSource configurationSource)
     => _isConcurrencyTokenConfigurationSource = configurationSource.Max(_isConcurrencyTokenConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例7: UpdateValueGeneratedConfigurationSource

 private void UpdateValueGeneratedConfigurationSource(ConfigurationSource configurationSource)
     => _valueGeneratedConfigurationSource = configurationSource.Max(_valueGeneratedConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例8: UpdateIsReadOnlyAfterSaveConfigurationSource

 private void UpdateIsReadOnlyAfterSaveConfigurationSource(ConfigurationSource configurationSource)
     => _isReadOnlyAfterSaveConfigurationSource = configurationSource.Max(_isReadOnlyAfterSaveConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例9: Ignore

        /// <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 void Ignore([NotNull] string name, ConfigurationSource configurationSource = ConfigurationSource.Explicit)
        {
            Check.NotNull(name, nameof(name));

            ConfigurationSource existingIgnoredConfigurationSource;
            if (_ignoredEntityTypeNames.TryGetValue(name, out existingIgnoredConfigurationSource))
            {
                configurationSource = configurationSource.Max(existingIgnoredConfigurationSource);
            }

            _ignoredEntityTypeNames[name] = configurationSource;
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:16,代码来源:Model.cs

示例10: UpdateIsNullableConfigurationSource

 private void UpdateIsNullableConfigurationSource(ConfigurationSource configurationSource)
     => _isNullableConfigurationSource = configurationSource.Max(_isNullableConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:Property.cs

示例11: UpdateDeleteBehaviorConfigurationSource

 private void UpdateDeleteBehaviorConfigurationSource(ConfigurationSource configurationSource)
     => _deleteBehaviorConfigurationSource = configurationSource.Max(_deleteBehaviorConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:2,代码来源:ForeignKey.cs

示例12: UpdateForeignKeyPropertiesConfigurationSource

 /// <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 void UpdateForeignKeyPropertiesConfigurationSource(ConfigurationSource configurationSource)
 {
     _foreignKeyPropertiesConfigurationSource = configurationSource.Max(_foreignKeyPropertiesConfigurationSource);
     foreach (var property in Properties)
     {
         property.UpdateConfigurationSource(configurationSource);
     }
 }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:12,代码来源:ForeignKey.cs

示例13: UpdateIsRequiredConfigurationSource

 /// <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 void UpdateIsRequiredConfigurationSource(ConfigurationSource configurationSource)
     => _isRequiredConfigurationSource = configurationSource.Max(_isRequiredConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:6,代码来源:ForeignKey.cs

示例14: UpdatePrincipalToDependentConfigurationSource

 /// <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 void UpdatePrincipalToDependentConfigurationSource(ConfigurationSource? configurationSource)
     => _principalToDependentConfigurationSource = configurationSource.Max(_principalToDependentConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:6,代码来源:ForeignKey.cs

示例15: UpdateDependentToPrincipalConfigurationSource

 /// <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 void UpdateDependentToPrincipalConfigurationSource(ConfigurationSource? configurationSource)
     => _dependentToPrincipalConfigurationSource = configurationSource.Max(_dependentToPrincipalConfigurationSource);
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:6,代码来源:ForeignKey.cs


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