lundi 7 juin 2021

Iterate through Linq fluent API methods (C#)

I am looking for a way to iterate through a collection of Linq methods, previously built, and then manipulate them, like change the expression tree.

Here is an example:

enter image description here

what i simply want to do is a forEach (or something of sorts) to get a cycle where:

i get the linq .Where(e => e.Summary == "sum") in the first position

i get the linq .Where(l => l.Description == "asd") in the second position

i get the linq .Take(2) in the last iteration

Is this posible? Most likely with reflection, but i could do it or find it.

Thank you





Aucun commentaire:

Enregistrer un commentaire