Esempio n. 1
0
        public static DynamicProperty Create(PropertyInfo propertyInfo)
        {
            DynamicProperty cached;

            lock (_dynamicPropertyCache)
            {
                if (!_dynamicPropertyCache.TryGetValue(propertyInfo, out cached))
                {
                    cached = new DynamicProperty(propertyInfo);
                    _dynamicPropertyCache.Add(propertyInfo, cached);
                }
            }
            return(cached);
        }
Esempio n. 2
0
        public static DynamicProperty Create(MemberExpression expression)
        {
            DynamicProperty cached;
            var             propertyInfo = (PropertyInfo)expression.Member;

            lock (_dynamicPropertyCache) {
                if (!_dynamicPropertyCache.TryGetValue(propertyInfo, out cached))
                {
                    cached = new DynamicProperty(expression);
                    _dynamicPropertyCache.Add(propertyInfo, cached);
                }
            }
            return(cached);
        }