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

[Duplicate] Remove Hardcoded 'Fred' from EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint Error Message #2992

Conversation

WanjohiSammy
Copy link
Contributor

@WanjohiSammy WanjohiSammy commented Jun 6, 2024

Issues

Description

To address the issue of the hardcoded 'Fred' argument in the EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint error message, this PR modify the error message template by removing the fourth parameter. This will prevent the display of the hardcoded value and ensure that the error message only contains relevant dynamic content.

Original error message template with 'Fred':
_

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}'.

_

Updated error message template without the hardcoded 'Fred':

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.

Main Changes:

  • Removed 4th parameter of EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint in Microsoft.OData.Edm.txt. Running Parameterized.Microsoft.OData.Edm.tt will generate EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint method with 3 parameters.
  • Modified NavigationPropertyTypeMismatchRelationshipConstraint method in ValidationRules.cs to remove 'Fred' passed as 4th argument in Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint.
  • Modified NavigationPropertyTypeMismatchOnReferentialConstraint test case to remove 'Fred' passed as 4th argument in Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Test case modified
  • Build and test with one-click build and test script passed

…lationshipConstraint which was hardcoded with argument 'Fred'
@WanjohiSammy WanjohiSammy marked this pull request as draft June 6, 2024 12:54
@WanjohiSammy WanjohiSammy marked this pull request as ready for review June 6, 2024 12:59
@WanjohiSammy
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@WanjohiSammy
Copy link
Contributor Author

Closing this as it is a duplicate of #2993

@WanjohiSammy WanjohiSammy deleted the fix/2888-referential-constraint-fred branch June 6, 2024 14:48
@WanjohiSammy WanjohiSammy changed the title Remove Hardcoded 'Fred' from EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint Error Message [Duplicate] Remove Hardcoded 'Fred' from EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint Error Message Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant