public JsonResult GetDatas(TableProcessModel table) { IDataTableService dataTableService = new DataTableService(); var result = dataTableService.GetData(table.TableName); return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public async Task <List <TemplateTableModel> > GetDatas(string table) { TableProcessModel tableProcessModel = new TableProcessModel { TableName = table }; var objDoc = JsonConvert.SerializeObject(tableProcessModel); var content = new StringContent(objDoc, Encoding.UTF8, "application/json"); var reponse = await _client.PostAsync(_uri + "Process/GetDatas", content); // On vérifie l'etat de la requete if (!reponse.IsSuccessStatusCode) { LogService.WriteLog(reponse); } var result = await reponse.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <List <TemplateTableModel> >(result)); }