public IActionResult upsert([FromBody] Model.Ticket ticket)
 {
     try
     {
         int ticketNumber = ticketsService.upsert(ticket);
         return(Ok(ticketNumber));
     }
     catch
     {
         return(StatusCode(500));
     }
 }
Esempio n. 2
0
        public void upsertTicket()
        {
            Model.Ticket ticket = new Model.Ticket()
            {
                Description = "Test",
                Comment     = "Comment",
                Category    = new Model.Category()
                {
                    Code = 1
                },
                Status = new Model.Status()
                {
                    Code = 1
                }
            };

            int newTicketNumber = iTicketService.upsert(ticket);

            Assert.NotEqual(0, newTicketNumber);
        }