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()); }
IEnumerable <T> IGenericProcessor <T> .Process(EntityPool entityPool, IDataContext db, IEnumerable <T> entities) { var result = _func(entityPool, db, entities); return(result); }