本文整理汇总了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;
}
示例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;
}
示例3: UpdateIsStoreGeneratedAlwaysConfigurationSource
private void UpdateIsStoreGeneratedAlwaysConfigurationSource(ConfigurationSource configurationSource)
=> _isStoreGeneratedAlwaysConfigurationSource = configurationSource.Max(_isStoreGeneratedAlwaysConfigurationSource);
示例4: UpdateIsUniqueConfigurationSource
private void UpdateIsUniqueConfigurationSource(ConfigurationSource configurationSource)
=> _isUniqueConfigurationSource = configurationSource.Max(_isUniqueConfigurationSource);
示例5: UpdateRequiresValueGeneratorConfigurationSource
private void UpdateRequiresValueGeneratorConfigurationSource(ConfigurationSource configurationSource)
=> _requiresValueGeneratorConfigurationSource = configurationSource.Max(_requiresValueGeneratorConfigurationSource);
示例6: UpdateIsConcurrencyTokenConfigurationSource
private void UpdateIsConcurrencyTokenConfigurationSource(ConfigurationSource configurationSource)
=> _isConcurrencyTokenConfigurationSource = configurationSource.Max(_isConcurrencyTokenConfigurationSource);
示例7: UpdateValueGeneratedConfigurationSource
private void UpdateValueGeneratedConfigurationSource(ConfigurationSource configurationSource)
=> _valueGeneratedConfigurationSource = configurationSource.Max(_valueGeneratedConfigurationSource);
示例8: UpdateIsReadOnlyAfterSaveConfigurationSource
private void UpdateIsReadOnlyAfterSaveConfigurationSource(ConfigurationSource configurationSource)
=> _isReadOnlyAfterSaveConfigurationSource = configurationSource.Max(_isReadOnlyAfterSaveConfigurationSource);
示例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;
}
示例10: UpdateIsNullableConfigurationSource
private void UpdateIsNullableConfigurationSource(ConfigurationSource configurationSource)
=> _isNullableConfigurationSource = configurationSource.Max(_isNullableConfigurationSource);
示例11: UpdateDeleteBehaviorConfigurationSource
private void UpdateDeleteBehaviorConfigurationSource(ConfigurationSource configurationSource)
=> _deleteBehaviorConfigurationSource = configurationSource.Max(_deleteBehaviorConfigurationSource);
示例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);
}
}
示例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);
示例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);
示例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);