예제 #1
0
        public virtual IProperty GetProperty(string propertyName)
        {
            lock (_syncRoot)
            {
                if (_propertiesCachedByPath.ContainsKey(propertyName))
                {
                    return(_propertiesCachedByPath[propertyName]);
                }
                var pi = TargetType.FindPropertyCaseInvariant(propertyName);
                if (pi == null)
                {
                    return(null);
                }

                var pa = SurrogateProperty(new ReflectionBasedProperty(TypeSystem, this, pi, null));
                _propertiesCachedByPath.Add(propertyName, pa);
                return(pa);
            }
        }