Skip to content

Make EngineEdition more readable#31038

Merged
roji merged 2 commits intodotnet:mainfrom
ErikEJ:issue-31037
Jun 7, 2023
Merged

Make EngineEdition more readable#31038
roji merged 2 commits intodotnet:mainfrom
ErikEJ:issue-31037

Conversation

@ErikEJ
Copy link
Copy Markdown
Contributor

@ErikEJ ErikEJ commented Jun 6, 2023

Fixes #31037

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

ErikEJ commented Jun 6, 2023

How will that work with other/new engineedition values?

@roji
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

ErikEJ commented Jun 7, 2023

@roji Updated

Copy link
Copy Markdown
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
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