public async Task <ActionResult> Create(ComentarioBindingModel comentario) { var model = new ComentarioDataModel() { Texto = comentario.Texto, PostId = comentario.PostId, PerfilId = comentario.PerfilId }; try { await _clientHelper.PostComentarioAsync(model); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <HttpResponseMessage> PutComentarioAsync(int id, ComentarioDataModel model) { return(await _client.PutAsJsonAsync($"api/Comentario/{id}", model)); }
// ComentarioHelper #region public async Task <HttpResponseMessage> PostComentarioAsync(ComentarioDataModel model) { return(await _client.PostAsJsonAsync("api/Comentario/Post", model)); }