static FastReflectionCaches() { MethodInvokerCache = new MethodInvokerCache(); PropertyAccessorCache = new PropertyAccessorCache(); FieldAccessorCache = new FieldAccessorCache(); ConstructorInvokerCache = new ConstructorInvokerCache(); }
public static void FastSetValue(this PropertyInfo propertyInfo, object instance, object value) => PropertyAccessorCache.Get(propertyInfo).SetValue(instance, value);
public static T FastGetValue <T>(this PropertyInfo propertyInfo, object instance) => (T)PropertyAccessorCache.Get(propertyInfo).GetValue(instance);