示例#1
0
 public async Task <IActionResult> UpdateNote([FromBody] NoteUpdateModel model)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             throw new Exception("Model not valid.");
         }
         return(Ok(await _noteService.Update(model, GetUserId())));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }