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 #2993

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

WanjohiSammy
Copy link
Contributor

Issues

This pull request fixes #2888

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'
Copy link
Contributor

@habbes habbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@WanjohiSammy WanjohiSammy merged commit 98155ac into main Jun 10, 2024
5 checks passed
@WanjohiSammy WanjohiSammy deleted the fix/2888-referential-constraint-fred branch June 10, 2024 09:26
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993)
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993)
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993)
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993)
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993)
WanjohiSammy added a commit that referenced this pull request Jun 10, 2024
…lationshipConstraint which was hardcoded with argument 'Fred' (#2993) (#3000)
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.

Referential constraint 'Fred'
3 participants