public static object CreateResponse(AppDataTablesRequest request, int totalRecord, int totalDisplayRecord, string[] data) { return(new { sEcho = request.sEcho, iTotalRecords = totalRecord, iTotalDisplayRecords = totalDisplayRecord, aaData = data }); }
public static object CreateResponse(AppDataTablesRequest request, int totalRecord, int totalDisplayRecord, object dataList) { //string[] data = dataList.ConvertAll(x => x.ToString()).ToArray(); string data = (JsonConvert.SerializeObject(new { dataList })); return(new { sEcho = request.sEcho, iTotalRecords = totalRecord, iTotalDisplayRecords = totalDisplayRecord, aaData = data }); }