Пример #1
0
        public async Task <IActionResult> ModifyTicket(long id, [FromBody] TicketDTO ticket)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }

            var entity = await service.ModifyTicketAsync(id, mapper.Map <Ticket>(ticket));

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