public async Task <IActionResult> Edit(int id, [Bind("HitRangeHeroID,NameHitRangeHero")] HitRangeHero hitRangeHero) { if (id != hitRangeHero.HitRangeHeroID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hitRangeHero); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HitRangeHeroExists(hitRangeHero.HitRangeHeroID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hitRangeHero)); }
public async Task <IActionResult> Create([Bind("HitRangeHeroID,NameHitRangeHero")] HitRangeHero hitRangeHero) { if (ModelState.IsValid) { _context.Add(hitRangeHero); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hitRangeHero)); }