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

Warn when uniquifying an FK column name #20435

Closed
Tracked by #22952
ajcvickers opened this issue Mar 27, 2020 · 4 comments · Fixed by #25478
Closed
Tracked by #22952

Warn when uniquifying an FK column name #20435

ajcvickers opened this issue Mar 27, 2020 · 4 comments · Fixed by #25478
Labels
area-conventions area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Member

Consider the case where there is a candidate FK property by name in the dependent CLR type, but it doesn't work for the FK for some other reason--commonly, that the type of the property is not compatible with the type of the PK property. In this case we currently create a shadow property with a uniquified name--e.g. BlogId1. I assert that this is almost always not what is wanted. We should consider making this a warning, or perhaps even an error by default.

@AnthonyGiretti
Copy link

Thank you I really appreciate!

@wenz
Copy link

wenz commented Mar 27, 2020

I agree, would be really useful, since I was hit by "SomeId1" a few times, as well.

@ajcvickers
Copy link
Member Author

Discussed with the team:

  • We currently have debug-level logging for this. We could promote this to warning, but sometimes the property will be removed later in the model build process as more information is gathered and conventions are re-run.
  • We could therefore instead keep track of when we're doing this, but then only warn if the synthesized properties remain in the final model.

@ajcvickers ajcvickers added this to the Backlog milestone Mar 27, 2020
@ajcvickers ajcvickers self-assigned this Mar 27, 2020
@AnthonyGiretti
Copy link

AnthonyGiretti commented Mar 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-conventions area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants