public async Task <ListaTerminos> IngresarTermino(string termmino, int ListaCodigo, string NombreLista) { CrearListaObj existe = null; try { existe = await requestHelperManagement.GetAsync <CrearListaObj>($"/termlists/{ListaCodigo}"); } catch (HttpRequestException hex) { } if (existe == null) { existe = await CrearLista(NombreLista); ListaCodigo = existe.Id; } await requestHelperManagement.PostAsync <string>($"/termlists/{ListaCodigo}/terms/{termmino}?language=spa"); await RefrescarLista(ListaCodigo); ListaTerminos listaact = await requestHelperManagement.GetAsync <ListaTerminos>($"/termlists/{ListaCodigo}/terms?language=spa"); return(listaact); }
public async Task <CrearListaObj> CrearLista(string NombreLista) { CrearListaObj crear = new CrearListaObj { Name = NombreLista, Description = NombreLista, Metadata = new Dictionary <string, string> { { "typem", "groserias" } } }; return(await requestHelperManagement.PostAsync <CrearListaObj, CrearListaObj>("/termlists", crear)); }