Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Hardcoded 'Fred' from EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint Error Message #3000

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,11 @@ internal static string EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinR
}

/// <summary>
/// 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."
/// </summary>
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);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OData.Edm/Validation/ValidationRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down