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

Make EngineEdition more readable #31038

Merged
merged 2 commits into from
Jun 7, 2023
Merged

Make EngineEdition more readable #31038

merged 2 commits into from
Jun 7, 2023

Conversation

ErikEJ
Copy link
Contributor

@ErikEJ ErikEJ commented Jun 6, 2023

Fixes #31037

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Should we just type _engineEdition as EngineEdition? This way we can remove all the pesky casts.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jun 6, 2023

How will that work with other/new engineedition values?

@roji
Copy link
Member

roji commented Jun 6, 2023

How will that work with other/new engineedition values?

It's always possible to cast the int read from the database to the enum - even if a label isn't defined for it. If we ever need to actually check that value, at that point we'd need to add a label for it, no?

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jun 6, 2023

So in the case of an int value of f.ex. 5 you can still do this?? Guess I know too little about enums 😅

(EngineEdition)_engineEdition

@roji
Copy link
Member

roji commented Jun 6, 2023

Yep :) You can always cast an enum to its underlying type (e.g. int) and vice versa.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jun 7, 2023

@roji Updated

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Thanks @ErikEJ!

roji

This comment was marked as duplicate.

@roji roji changed the title Make EngineEdition more readable - Make EngineEdition more readable Jun 7, 2023
@roji roji merged commit 74da467 into dotnet:main Jun 7, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make EngineEdition easier to understand
3 participants