public async Task <IActionResult> Create([Bind("Id,FullName,Dorsal,DoB,EmailPlayer")] Player player) { if (ModelState.IsValid) { _context.Add(player); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(player)); }
public async Task <IActionResult> Create([Bind("Id,FullName,Dorsal,DoB,EmailPlayer,SoccerPositionId")] Player player) { if (ModelState.IsValid) { _context.Add(player); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SoccerPositionId"] = new SelectList(_context.SoccerPosition, "Id", "Code", player.SoccerPositionId); return(View(player)); }