public static IEnumerable <PropertyAndFieldAccessor> Get(Type classType, Func <PropertyAndFieldAccessor, bool> predicate = null) { PropertyAndFieldCache ret = null; lock (lockCaches) { if (!caches.TryGetValue(classType, out ret)) { ret = new PropertyAndFieldCache(classType); caches[classType] = ret; } } if (predicate == null) { return(ret.Members); } return(ret.Members.Where(predicate)); }
public static IEnumerable <PropertyAndFieldAccessor> GetPropsAndFields <T>(Func <PropertyAndFieldAccessor, bool> predicate = null) where T : class { return(PropertyAndFieldCache.Get <T>(predicate)); }
public static IEnumerable <PropertyAndFieldAccessor> GetPropsAndFields(Type t, Func <PropertyAndFieldAccessor, bool> predicate = null) { return(PropertyAndFieldCache.Get(t, predicate)); }