예제 #1
0
        internal static List <T> ProcessEntities <T>(EntityPool entityPool, IDataContext db, IEnumerable <T> entities)
            where T : class
        {
            if (!entityPool.ConsolidateEntities)
            {
                return(entities.ToList());
            }

            var type = typeof(T);

            var processor    = _processors.GetOrAdd(type, t => new GenericProcessor <T>());
            var runProcessor = processor as IGenericProcessor <T>;

            return(runProcessor.Process(entityPool, db, entities).ToList());
        }
예제 #2
0
        IEnumerable <T> IGenericProcessor <T> .Process(EntityPool entityPool, IDataContext db, IEnumerable <T> entities)
        {
            var result = _func(entityPool, db, entities);

            return(result);
        }