mardi 5 février 2019

How do I get value from a nested array with reflection?

I wrote this code but it's looking dirty and insufficient.

filterTarget = filterTarget.Where(x =>  x.GetType().GetProperty(fieldval1).PropertyType.GetProperty(fieldval2).GetValue(x.GetType().GetProperty(fieldval1).GetValue(x)).ToString()?.ToLower() == deger).ToList();

How do I get value from a nested array with reflection and linq?





Aucun commentaire:

Enregistrer un commentaire