示例#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);
        }