Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }