Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="query">Must have [string text] and [int id] field</param>
 /// <param name="request"></param>
 public Select2Response(IQueryable <ISelect2Item> query, ISelect2Request request)
 {
     TotalCount   = query.Count();
     HasMorePages = request.PageNumber * request.PageSize <= TotalCount;
     Items        = query.Skip((request.PageNumber - 1) * request.PageSize)
                    .Take(request.PageSize)
                    .ToList();
 }
Beispiel #2
0
 public new JsonResult Response(IQueryable <ISelect2Item> query, ISelect2Request request)
 {
     return(Json(new Select2Response(query, request), JsonRequestBehavior.AllowGet));
 }