public IActionResult Put([FromBody] PalestraViewModel palestraViewModel) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(palestraViewModel)); } _palestraAppService.Update(palestraViewModel); return(Response(palestraViewModel)); }
public IActionResult Edit(PalestraViewModel palestraViewModel) { ViewBag.PalestranteId = new SelectList(_palestranteAppService.GetAll(), "Id", "Nome", palestraViewModel.PalestranteId); if (!ModelState.IsValid) { return(View(palestraViewModel)); } _palestraAppService.Update(palestraViewModel); if (IsValidOperation()) { ViewBag.Sucesso = "Palestra Atualizada!"; } return(View(palestraViewModel)); }