Esempio n. 1
0
        public IActionResult ModifyTicket(int id, [FromBody] Ticket ticket)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }
            var entity = service.ModifyTicket(ticket);

            return(entity == null?StatusCode(304) as IActionResult : Ok(entity));
        }
Esempio n. 2
0
        public IActionResult ModifyTicket([FromBody] TicketDTO ticket)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }

            var entity = service.ModifyTicket(mapper.Map <Ticket>(ticket));

            return(entity == null?StatusCode(304) as IActionResult
                   : Ok(mapper.Map <Ticket>(entity)));
        }