Alternatives to PropertyInfo.GetValue() for Mono?
Posted
by Trilok
on Stack Overflow
See other posts from Stack Overflow
or by Trilok
Published on 2010-06-18T14:38:30Z
Indexed on
2010/06/18
14:43 UTC
Read the original article
Hit count: 205
I have a method that has the following signature:
private object GetNestedObject<y>(y objToAccess, string nestedObjectName)
I'm using Reflection to get the nestedObject from the objToAccess and return it.
This works well except it's really slow (I have to do this a few hundred thousand times). I came across HyperDescriptor, but since I'm running this on Linux, and Mono doesn't support TypeDescriptionProviders, I can't use it.
Are there any alternatives to using getValue in this case? I could always hardcode in overrides for each type, but that is not desirable and would add a lot of maintenance overhead in my case.
© Stack Overflow or respective owner