diff --git a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt index cc1acb9cdf..8b9145e793 100644 --- a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt +++ b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt @@ -62,7 +62,7 @@ EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentProperties EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne=The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties represent the dependent end key, the multiplicity of the dependent end must be '0..1' or '1'. EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany=The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties don't represent the dependent end key, the the multiplicity of the dependent end must be '*'. EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint=The number of properties in the dependent and principal role in a relationship constraint must be exactly identical. -EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint=The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint '{4}'. +EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint=The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint. EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd=There is no property with name '{0}' defined in the type referred to by role '{1}'. EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd=The principal end properties in the referential constraint of the association '{0}' do not match the key of the type referred to by role '{1}'. EdmModel_Validator_Semantic_InvalidPropertyType=A property cannot be of type '{0}'. The property type must be a complex, a primitive, an enum, a type definition or an untyped type, or a collection of complex, primitive, enum types, or type definition. diff --git a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs b/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs index 43fa85a449..0432d90c63 100644 --- a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs +++ b/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs @@ -512,11 +512,11 @@ internal static string EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinR } /// - /// A string like "The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint '{4}'." + /// A string like "The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint." /// - internal static string EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(object p0, object p1, object p2, object p3, object p4) + internal static string EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(object p0, object p1, object p2, object p3) { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint, p0, p1, p2, p3, p4); + return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint, p0, p1, p2, p3); } /// diff --git a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs index a0f49fa577..92277a59c5 100644 --- a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs +++ b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs @@ -1611,7 +1611,7 @@ Dependent properties | | | | var principalType = principalProperties.ElementAtOrDefault(i).Type.Definition; if (!(dependentType is BadType) && !(principalType is BadType) && !dependentType.IsEquivalentTo(principalType)) { - string errorMessage = Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(navigationProperty.DependentProperties().ToList()[i].Name, navigationProperty.DeclaringEntityType().FullName(), principalProperties.ToList()[i].Name, principalEntityType.Name, "Fred"); + string errorMessage = Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(navigationProperty.DependentProperties().ToList()[i].Name, navigationProperty.DeclaringEntityType().FullName(), principalProperties.ToList()[i].Name, principalEntityType.Name); context.AddError(navigationProperty.Location(), EdmErrorCode.TypeMismatchRelationshipConstraint, errorMessage); } diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs index a8f5c78561..f5503dd1c5 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs @@ -1003,7 +1003,7 @@ public void NavigationPropertyTypeMismatchOnReferentialConstraint() ValidationRules.NavigationPropertyTypeMismatchRelationshipConstraint, navProp, EdmErrorCode.TypeMismatchRelationshipConstraint, - Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint("foreignKey", "ns.type2", "Id1", "type1", "Fred")); + Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint("foreignKey", "ns.type2", "Id1", "type1")); } [Fact]