示例#1
0
        public async Task <IActionResult> PutTicketDetail(int id, TicketDetail ticketDetail)
        {
            if (id != ticketDetail.Ticketid)
            {
                return(BadRequest());
            }

            _context.Entry(ticketDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TicketDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutCreateTicket(int id, CreateTicket createTicket)
        {
            if (id != createTicket.TicketId)
            {
                return(BadRequest());
            }

            _context.Entry(createTicket).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CreateTicketExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }