Пример #1
0
 public IHttpActionResult Put(int id, [FromBody] NoteModel noteModel)
 {
     if (ModelState.IsValid)
     {
         var result = NoteModel.Update(noteModel);
         return(Ok());
     }
     return(BadRequest());
 }
Пример #2
0
 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()));
     }
 }