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