Example #1
0
        public async Task <IActionResult> LoadTable([FromBody] DTParameters table)
        {
            try
            {
                var items = await _dtService.GetDataAsync(table);

                return(new JsonResult(new DTResult <Notification>
                {
                    draw = table.Draw,
                    data = items,
                    recordsFiltered = _dtService.TotalRecords(),
                    recordsTotal = _dtService.TotalRecords()
                }));
            }
            catch (Exception e)
            {
                Console.Write(e.Message);
                return(new JsonResult(new { error = "Internal Server Error" }));
            }
        }