Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public static IEnumerable <PropertyAndFieldAccessor> GetPropsAndFields <T>(Func <PropertyAndFieldAccessor, bool> predicate = null)
     where T : class
 {
     return(PropertyAndFieldCache.Get <T>(predicate));
 }
Exemplo n.º 3
0
 public static IEnumerable <PropertyAndFieldAccessor> GetPropsAndFields(Type t, Func <PropertyAndFieldAccessor, bool> predicate = null)
 {
     return(PropertyAndFieldCache.Get(t, predicate));
 }