public IHttpActionResult Put(int id, [FromBody] NoteModel noteModel) { if (ModelState.IsValid) { var result = NoteModel.Update(noteModel); return(Ok()); } return(BadRequest()); }
public IActionResult Update(string text, int uid) { try { NoteModel note = new NoteModel(uid); note.Text = text; note.Update(); return(Redirect("/Beleska")); } catch (Exception ex) { return(View("Error", ex.ToString())); } }