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