public async Task <IActionResult> Edit(string id, [Bind("PlayerId,Player,Matches,Wickets")] TopBowler topBowler) { if (id != topBowler.Player) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(topBowler); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopBowlerExists(topBowler.Player)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(topBowler)); }
public async Task <IActionResult> Create([Bind("PlayerId,Player,Matches,Wickets")] TopBowler topBowler) { if (ModelState.IsValid) { _context.Add(topBowler); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(topBowler)); }