public async Task <IActionResult> Create([Bind("GameId,GameName,DateCreated")] Games games) { if (ModelState.IsValid) { _context.Add(games); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(games)); }
public async Task <IActionResult> Create([Bind("CharacterId,TeamId,FirstName,LastName,Age,Hometown,Ability,Bio,Weapon,UserAccountedId")] Characters characters) { if (ModelState.IsValid) { _context.Add(characters); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TeamId"] = new SelectList(_context.Teams, "TeamId", "TeamName", characters.TeamId); return(View(characters)); }
public async Task <IActionResult> Create([Bind("TeamId,GameId,TeamName,DateCreated")] Teams teams) { if (ModelState.IsValid) { _context.Add(teams); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GameId"] = new SelectList(_context.Games, "GameId", "GameName", teams.GameId); return(View(teams)); }