I\'m trying to improve my reflection code by creating Delegates for the Getter
and Setter
methods.
My code looks like this:
MyO
Is there a reason why you need to use Action
If not you can use PropertyInfo.GetMethod() and SetMethod()
MyObject obj = new MyObject();
PropertyInfo prop = obj.GetType().GetProperty("Prop");
MethodInfo getter = prop.GetMethod();
getter.Invoke(...)
MethodInfo setter = prop.SetMethod();
setter.Invoke(...)