I am coming from Perl doing first steps with C# and Linq. My question is if there is a way to put parts of a Linq statement in a variable like this (Code only for short illustration, not tested) to use it several times more easily and flexible than writing it new every time. Also one could use different Order-Statements (Select-Case, Array) for the same MQuery.
var orderstatement = "orderby m.Reihenfolge ascending, m.Datum descending, m.Titel ascending";
var MQuery = (from m in _context.Movie
orderstatement
where m.Sichtbar == true && m.Gesperrt == false
select m;
Thanks for advising.