public async Task <IActionResult> Edit(int id, [Bind("Id,Resposta,Mensagem")] RespostaChat respostaChat) { if (id != respostaChat.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(respostaChat); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RespostaChatExists(respostaChat.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(respostaChat)); }
public async Task <IActionResult> Create([Bind("Id,Resposta,Mensagem")] RespostaChat respostaChat) { if (ModelState.IsValid) { _context.Add(respostaChat); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(respostaChat)); }