예제 #1
0
 public ActionResult <Models.Ticket> CreateTicket(TicketDto ticketDto)
 {
     try
     {
         return(Created("https://localhost:5001/Ticket",
                        new OkResponse <Models.Ticket>(_ticket.CreateTicket(ticketDto))));
     }
     catch (TicketTypeNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(BadRequest(new ErrorResponse(e.Message, new List <string>()
         {
             "ticket"
         })));
     }
 }