i have a struct who have a list of item and some other variable about struct
i want to check that a enum in list have a specific value or not.
like
struct.list.havevalue == 5;
how i can count all who have the specific value in enum in the itemlist of the structure
Your question isn’t really clear, but it sounds like you might want to use LINQ:
But without anything more specific about what types are involved, it’s very hard to say. If you could provide more details – such as the declaration of the types involved – it would really help.
By the way, it’s very odd for a struct to contain a list. Are you really sure you want to be using a struct rather than a class?