Exemple #1
0
        public async Task <IActionResult> GetDataAsync([FromForm] DataParameters parameters)
        {
            Guard.ThrownExceptionIfNull(parameters, nameof(parameters));

            var items = await _postService.GetForDataTable(parameters);

            var dataTable = DataTableHelper.BuildDataTable(items.Data, items.RecordsTotal, items.RecordsFiltered, parameters.Draw, parameters.Start, parameters.Length);

            return(Ok(dataTable));
        }
Exemple #2
0
        public IActionResult GetPeopleData(DataParameters parameters)
        {
            var items = personService.GetPeopleForDataTable(parameters);

            var dataTable = DataTableHelper.BuildDataTable(items.Data, items.Count);

            dataTable.Draw = parameters.Draw;

            return(Ok(dataTable));
        }