コード例 #1
0
        public virtual List <TProjection> GetAllList <TProjection>(Options.GetAllProjectedOptions <TEntity, TPrimaryKey, TProjection> options) where TProjection : class
        {
            IQueryable <TProjection> query = AsQueryable <TProjection>(
                projection: options?.Projection,
                predicate: null,
                sort: options?.Sort,
                entitiesToSkip: options?.EntitiesToSkip,
                entitiesToTake: options?.EntitiesToTake);

            return(query.ToList());
        }
コード例 #2
0
        public virtual List <TProjection> GetAllList <TProjection>(Options.GetAllProjectedOptions <TEntity, TPrimaryKey, TProjection> options, out long totalEntities) where TProjection : class
        {
            IQueryable <TProjection> countQuery = AsQueryable <TProjection>(projection: options?.Projection);

            totalEntities = countQuery.LongCount();

            IQueryable <TProjection> listQuery = AsQueryable <TProjection>(
                projection: options?.Projection,
                predicate: null,
                sort: options?.Sort,
                entitiesToSkip: options?.EntitiesToSkip,
                entitiesToTake: options?.EntitiesToTake);

            return(listQuery.ToList());
        }
コード例 #3
0
 public virtual Task <List <TProjection> > GetAllListAsync <TProjection>(Expression <Func <TEntity, bool> > predicate, Options.GetAllProjectedOptions <TEntity, TPrimaryKey, TProjection> options, out long totalEntities) where TProjection : class
 {
     return(Task.FromResult(GetAllList <TProjection>(predicate, options, out totalEntities)));
 }
コード例 #4
0
 public virtual Task <List <TProjection> > GetAllListAsync <TProjection>(Options.GetAllProjectedOptions <TEntity, TPrimaryKey, TProjection> options, out long totalEntities) where TProjection : class
 {
     return(Task.FromResult(GetAllList <TProjection>(options, out totalEntities)));
 }