public IPropertyMetadata GetProperty(string propertyName)
 {
     if (_properties.TryGetValue(propertyName, out var prop))
     {
         return(prop);
     }
     if (BaseEntityType == null)
     {
         return(null);
     }
     return(BaseEntityType.GetProperty(propertyName));
 }
Example #2
0
        public DynPropertyConfiguration GetProperty(string propertyName)
        {
            if (_properties.Contains(propertyName))
            {
                return(_properties[propertyName]);
            }
            else
            {
                if (!string.IsNullOrEmpty(_baseEntityName) && BaseEntityType != null)
                {
                    DynPropertyConfiguration inheritedProperty = BaseEntityType.GetProperty(propertyName);
                    inheritedProperty.IsInherited = true;
                    if (inheritedProperty.InheritEntityMappingName == null)
                    {
                        inheritedProperty.InheritEntityMappingName = BaseEntityType.Name;
                    }
                    return(inheritedProperty);
                }

                throw new ApplicationException("当前类或基类没有名称为" + propertyName + "的属性!");
            }
        }