mardi 19 novembre 2019

Reflection performance optimize

I have used the reflection to get the value like a below one.

this.GetRflValue(list[i], propertyName)

internal object GetRflValue(object cmp, string prp)

{

if (this.propInfo.TryGetValue(prp, out pInfo))


{

o = pInfo.GetValue(cmp, null);

   }

}

Here propInfo is a dictionary and it has //cmp.GetType().GetProperties();// value, still i have loaded this at once. But it take much time to iterate my whole record, so please suggest and give the example to achieve this case with user friendly performance.





Aucun commentaire:

Enregistrer un commentaire