private static void ValidateContractCompatibility(IEnumerable <string> parameterNames, IReadOnlyDictionary <string, Type> bindingDataContract)
        {
            if (parameterNames != null && bindingDataContract != null)
            {
                foreach (string parameterName in parameterNames)
                {
                    if (BindingParameterResolver.IsSystemParameter(parameterName))
                    {
                        continue;
                    }

                    if (!bindingDataContract.ContainsKey(parameterName))
                    {
                        throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "No binding parameter exists for '{0}'.", parameterName));
                    }
                }
            }
        }
        private static void ValidateContractCompatibility(IEnumerable <string> parameterNames, IReadOnlyDictionary <string, Type> bindingDataContract)
        {
            if (parameterNames != null && bindingDataContract != null)
            {
                foreach (string parameterName in parameterNames)
                {
                    if (string.Equals(parameterName, SystemBindingData.Name, StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }
                    if (BindingParameterResolver.IsSystemParameter(parameterName))
                    {
                        continue;
                    }

                    if (!bindingDataContract.ContainsKey(parameterName))
                    {
                        throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Constants.UnableToResolveBindingParameterFormat, parameterName));
                    }
                }
            }
        }
Пример #3
0
 public void IsSystemParameter_ReturnsExpectedValue(string value, bool expected)
 {
     Assert.Equal(expected, BindingParameterResolver.IsSystemParameter(value));
 }