I have a select query which is used over and over with different where filters:
var query = from row in context.Table select row;
How can I save this into a static class variable so I can reuse it in different methods? Like:
var results1 = query.Where(condition1);
...
var results2 = query.Where(condition2);
You’re on the right track.
Consider creating a new method instead of a variable:
You can then consume this from anywhere that method is visible: