public async Task <IActionResult> Create([Bind("ID,Brand,Name,Use,Support")] Shoe shoe) { if (ModelState.IsValid) { _context.Add(shoe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(shoe)); }
public async Task <IActionResult> Create([Bind("ID,RaceDate,RaceName,City,State")] Race race) { if (ModelState.IsValid) { _context.Add(race); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(race)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,Age,Address,City,State,Zip,Email,PhoneNumber,RaceId,ShoeId")] Registrant registrant) { if (ModelState.IsValid) { _context.Add(registrant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RaceId"] = new SelectList(_context.Race, "ID", "RaceName", registrant.RaceId); ViewData["ShoeId"] = new SelectList(_context.Shoe, "ID", "Brand", registrant.ShoeId); return(View(registrant)); }