protected override void UpdatePaginationBar()
        {
            PagingMeta meta = base.GetPagingMeta();

            if (meta != null)
            {
                this.PagingMeta.Text      = meta.Meta;
                this.PagingPageCount.Text = meta.PageCount;
            }
        }
Beispiel #2
0
        public async Task <IActionResult> Query([FromQuery] int?page = 1, [FromQuery] int?pageSize = 10, [FromQuery] string filter = null, [FromQuery] string orderBy = "CreateDate DESC")
        {
            var sw = new Stopwatch();

            sw.Start();
            var result = await _mediator.Send(new PagedQuery <Document>((int)page, (int)pageSize, filter, orderBy));

            sw.Stop();

            var pagingMeta = PagingMeta.Create(result.TotalRows, (int)pageSize, (int)page);

            pagingMeta.Elapsed = sw.Elapsed;

            return(Ok(new
            {
                meta = pagingMeta,
                data = result.Data
            }));
        }