コード例 #1
0
        private static bool CanSetAnnotationValue(
            ConventionalAnnotation annotation, object value, ConfigurationSource configurationSource, bool canOverrideSameSource)
        {
            if (Equals(annotation.Value, value))
            {
                return(true);
            }

            var existingConfigurationSource = annotation.GetConfigurationSource();

            return(!configurationSource.Overrides(existingConfigurationSource) ||
                   ((configurationSource == existingConfigurationSource) && !canOverrideSameSource)
                ? false
                : true);
        }
コード例 #2
0
        private bool CanSetAnnotationValue(
            ConventionalAnnotation annotation, object value, ConfigurationSource configurationSource, bool canOverrideSameSource)
        {
            if (annotation.Value.Equals(value))
            {
                return true;
            }

            var existingConfigurationSource = annotation.GetConfigurationSource();
            if (!configurationSource.Overrides(existingConfigurationSource)
                || ((configurationSource == existingConfigurationSource) && !canOverrideSameSource))
            {
                return false;
            }

            return true;
        }