Esempio n. 1
0
        public static async Task <CursorResultViewModel <TEntity> > BuildAsync(IQueryable <TEntity> query, string sortOrder, int limit)
        {
            var unlimitCnt = await query.LongCountAsync();

            var limitListResult = await query.SortBy(sortOrder).Take(limit).ToListAsync();

            var cmd  = new CursorMetaData <TEntity>(limitListResult, sortOrder, limit, unlimitCnt);
            var crvm = new CursorResultViewModel <TEntity>(limitListResult, cmd);

            return(crvm);
        }
Esempio n. 2
0
 /// <summary>
 /// 결과 객체와 메타 정보를 한번에 저장하기 위한 생성자
 /// </summary>
 /// <param name="result"></param>
 /// <param name="MetaData"></param>
 public CursorResultViewModel(IEnumerable <TEntity> result, CursorMetaData <TEntity> MetaData)
 {
     this.Result   = result;
     this.MetaData = MetaData;
 }