Пример #1
0
 public ActionResult <Ticket> Edit(int id, [FromBody] Ticket Ticket)
 {
     try
     {
         Ticket.Id = id;
         string nameIdentifier = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         if (nameIdentifier != null)
         {
             return(Ok(value: _ticketsService.Edit(Ticket)));
         }
         else
         {
             throw new UnauthorizedAccessException("Unauthorized");
         }
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }