public JsonResult FraisSupplementaires([FromBody] Pagination pagination) { if (pagination != null) { var results = _formationService.GetFraisSupplementaires(); if (!String.IsNullOrEmpty(pagination.Search)) { results = _formationService.GetFraisSupplementaires().Where(i => i.Nom.Contains(pagination.Search)); } int totalRows = results.Count(); Util.Paginate <FraisSupplementaire>(pagination, ref results); return(Json(new { Rows = results.ToList(), FilteredTotalRows = results.Count(), TotalRows = totalRows })); } else { return(Json(new { Rows = new List <FraisSupplementaire>(), FilteredTotalRows = 0, TotalRows = 0 })); } }