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

Add a parameter to Optimize-DbContext for fully qualifying types #27203

Open
AndriySvyryd opened this issue Jan 18, 2022 · 8 comments
Open

Add a parameter to Optimize-DbContext for fully qualifying types #27203

AndriySvyryd opened this issue Jan 18, 2022 · 8 comments

Comments

@AndriySvyryd
Copy link
Member

See #25523 (comment)

@viniciusverasdossantos
Copy link

There is an alternative solution? My domain has many entities and I have more than 400 conflicts

@ronymeyer
Copy link

There is an alternative solution? My domain has many entities and I have more than 400 conflicts

Workaround is mentioned here: #25523 (comment)

@ajcvickers
Copy link
Member

Adding a note to help me find this in the future; fully-qualified typed for compiled model. :-)

@roji
Copy link
Member

roji commented Jan 9, 2024

Just because I just saw this: should we maybe consider just always fully-qualifying? I think that's generally consider best practice in generated code (dealt with some similar issues in precompiled queries), and there's no real downside except more verbose generated code, which nobody cares about...

@AndriySvyryd
Copy link
Member Author

should we maybe consider just always fully-qualifying?

Sure and we can add an opt-out instead

@roji
Copy link
Member

roji commented Jan 10, 2024

FWIW it seems to be standard practice (e.g. in source generators) for generated code to just always be fully-qualified (including the global:: prefix for maximum disambiguation). Given that this is generated code and readability shouldn't be a big priority, is it worth even having an opt-out?

@AndriySvyryd
Copy link
Member Author

For big models this could mean a lot of additional code, like tens of megabytes more.

@ajcvickers
Copy link
Member

Note from triage: we should do this by default, since the code is not intended to be edited, but with a switch to turn it off due to the increase in size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants