Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }