public void Alterar(Nsf.App.Model.TurmaModell turma) { string json = JsonConvert.SerializeObject(turma); StringContent body = new StringContent(json, Encoding.UTF8, "application/json"); var resp = client.PutAsync("http://localhost:5000/Turma/", body) .Result .Content .ReadAsStringAsync() .Result; VerificarErro(resp); }
public Model.TurmaModell Cadastrar(Nsf.App.Model.TurmaModell turma) { string json = JsonConvert.SerializeObject(turma); StringContent body = new StringContent(json, Encoding.UTF8, "application/json"); var resp = client.PostAsync("http://localhost:5000/Turma/", body) .Result .Content .ReadAsStringAsync() .Result; return(JsonConvert.DeserializeObject <Model.TurmaModell>(resp)); }