public async Task <IActionResult> Edit(int id, [Bind("Id,Category,TeamName,League,Esource,Seatgeek,Ticketmaster,Stubhub")] TicketOptions ticketOptions) { if (id != ticketOptions.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ticketOptions); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TicketOptionsExists(ticketOptions.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ticketOptions)); }
public async Task <IActionResult> Create([Bind("Id,Category,TeamName,League,Esource,Seatgeek,Ticketmaster,Stubhub")] TicketOptions ticketOptions) { if (ModelState.IsValid) { _context.Add(ticketOptions); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ticketOptions)); }