mercredi 10 février 2016

How to build a chained expression methods Any

I'm trying to evaluate an expression of chained Any method call:

Well, I have a notation as string like this:

A[B[C]]

The A letter is a property and it is a collection. B is a property of A and it is a collection too. C is a property of B and it is the end of chain.

That notation will be right like below:

A.Any(a => a.B.Any(b => b.C == value)

I'm trying to write reflection code to solve this problems using a recursive solution but I'm fail.

If I'm not clear, ask me please.

Could anyone help me?

Regards





Aucun commentaire:

Enregistrer un commentaire