-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Introduce a way to enumerate the enum values without memory allocation #497
Conversation
We don't need to expose a new API here. Instead, we need to fix the public static IReadOnlyCollection<TEnum> List => _enumOptions.Value; |
@akarboush @ardalis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the related issue, I suggested returning IReadOnlyList
so the users may use also for
iteration. Since it inherits from IReadOnlyCollection
it won't be a breaking change.
Also, I suggested keeping the state as ReadOnlyCollection
, otherwise the users will be able to cast back to an array.
Anyhow, @ardalis let's merge this PR as is. We'll tackle those details additionally.
Done |
Fixes #494
Fixes #521