public static void SetValue(PropertyInfo property, object instance, object value) { var key = GetMethodCacheKey(property); if (ActionCache.TryGetValue(key, out Action <object, object> a) == false) { a = MakeSetMethod(property.GetSetMethod(), property.PropertyType); ActionCache[key] = a; } a(instance, value); }
public static void SetValue(PropertyInfo property, object instance, object value) { var key = GetMethodCacheKey(property); Action <object, object> a; if (!ActionCache.TryGetValue(key, out a)) { a = BuildSetAccessor(property.GetSetMethod()); ActionCache[key] = a; } a?.Invoke(instance, value); }