I am new to c# with linq and I am trying to figure out how to do multiple filtering selection with buttons.
I am connected to a database,
I have enum stats{approved, rejected, pending approval, pending rejected, cancelled};
A IEnumerator
type List, how do I do in such a way that the code can be more manageable as one can keep adding N number of choices in the future and it will still work rather than using if else or switch cases
to hard code all possible cases.
e.g.
if(stats contains approve)
List = List.dbset.where(x => x.id.stats == approved);
//return the view that displays all the list of things with stats approved.
Am not sure how am I going to combine it into a loop. Require some assistance.
Desired output is I can select 2 or more buttons and the list returns those selected filter values element out.