public JsGridStorageStatistics GetAllTop(HttpRequestMessage request, string dataAccess, ODataQueryOptions opt, int take, int skip) { var sample = this.GetFilterInstance <TEntity>(HttpUtility.ParseQueryString(request.RequestUri.Query)); JsGridStorageStatistics result = this.jsGridDataStorage.LoadAllTop(dataAccess, take, (sample), opt, skip); return(new JsGridStorageStatistics { Total = result.Total, Results = result.Results.Select(x => (object)((TEntity)x)) }); }
public virtual PageResult <dynamic> Get(ODataQueryOptions opts, [FromUri] string dataaccess) { if (!GridRequestOptions.IsAuthorized(Request)) { return(new PageResult <dynamic>(new List <dynamic>(), null, 0)); } #region MyRegion JsGridStorageStatistics all = opts.Top == null? this.Service.GetAll(this.Request, dataaccess, opts) : this.Service.GetAllTop(this.Request, dataaccess, opts, opts.Top?.Value ?? 100, opts.Skip?.Value ?? 0); #endregion return(new PageResult <dynamic>(all.Results, null, all.Total)); }