public async Task <IActionResult> Edit(int id, [Bind("ID,BikerName,BikerSponsor,BikerCarreerWinnings,BikerLink")] Bikers bikers) { if (id != bikers.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bikers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BikersExists(bikers.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bikers)); }
public async Task <IActionResult> Create([Bind("ID,BikerName,BikerSponsor,BikerCarreerWinnings,BikerLink")] Bikers bikers) { if (ModelState.IsValid) { _context.Add(bikers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bikers)); }