public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Surname,Email,Description")] Message message) { if (id != message.Id) { return(NotFound()); } if (ModelState.IsValid) { try { await messageRepo.UpdateAsync(message); } catch (DbUpdateConcurrencyException) { if (!MessageExists(message.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(MyMessages))); } return(View(message)); }