public static PropertyAccess WrapProperty(PropertyInfo property) { PropertyAccess access = (PropertyAccess)_cache[property]; if (access == null) { if (_cache.Count > _cacheCapacity) { _cache.Clear(); } _cache[property] = access = new PropertyAccess(property); } return(access); }
public static IEnumerable <PropertyAccess> GetEnumerable(Type entityType) { do { MetaTable table; if (MetaTable.TryGetTable(entityType, out table)) { foreach (var item in table.Columns) { yield return(item); } } else { PropertyInfo[] array = entityType.GetProperties(PropertyAccess.PropertyBinding); for (int i = 0; i < array.Length; i++) { yield return(PropertyAccess.WrapProperty(array[i])); } } }while ((entityType = entityType.BaseType) != typeof(object)); }