public async Task <IActionResult> Create([Bind("DivisionId,Name,SkillLevel")] Division division) { if (ModelState.IsValid) { _context.Add(division); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(division)); }
public async Task <IActionResult> Create([Bind("PlayerId,Name,PaidDues,TeamId")] Player player) { if (ModelState.IsValid) { _context.Add(player); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["TeamId"] = new SelectList(_context.Teams, "TeamId", "TeamId", player.TeamId); return(View(player)); }
public async Task <IActionResult> Create([Bind("TeamId,Name,DivisionId")] Team team) { if (ModelState.IsValid) { _context.Add(team); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["DivisionId"] = new SelectList(_context.Divisions, "DivisionId", "DivisionId", team.DivisionId); return(View(team)); }