public async Task <IActionResult> PutEventTicketHistory([FromRoute] Guid id, [FromBody] EventTicketHistory eventTicketHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != eventTicketHistory.EventTicketHistoryId) { return(BadRequest()); } _context.Entry(eventTicketHistory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventTicketHistoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostEventTicketHistory([FromBody] EventTicketHistory eventTicketHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.EventTicketHistories.Add(eventTicketHistory); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEventTicketHistory", new { id = eventTicketHistory.EventTicketHistoryId }, eventTicketHistory)); }