public async Task <IActionResult> Edit(int id, [Bind("DogRaceId,Race,Description")] DogRace dogRace) { if (id != dogRace.DogRaceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dogRace); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DogRaceExists(dogRace.DogRaceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dogRace)); }
public async Task <IActionResult> Create([Bind("DogRaceId,Race,Description")] DogRace dogRace) { if (ModelState.IsValid) { _context.Add(dogRace); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dogRace)); }