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

Ordering the values #411

Open
pauldbentley opened this issue Jul 26, 2023 · 0 comments
Open

Ordering the values #411

pauldbentley opened this issue Jul 26, 2023 · 0 comments

Comments

@pauldbentley
Copy link

pauldbentley commented Jul 26, 2023

Hi @ardalis I know there has been some discussion here #293 about getting all the enum values.

What is your current approach to displaying enum values in a specific order?

I've potentially thought about adding a new implementation of the List property to my enum type

public static new IReadOnlyCollection<MyEnum> List

And returning the values in the order I want, unless that causes problems in other places this is used.

Or adding a GetAll() but then I think that is confusing when you have the List property.

Adding the source generator in #259 could define an order e.g. [EnumMember(Order = 1)] or some other method i.e. the order in which they are defined on the class, but I don't know the status of this item.

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

No branches or pull requests

1 participant