public async Task <IActionResult> Create([Bind("Id,Name,CountryRecord")] Country country)
        {
            if (ModelState.IsValid)
            {
                _context.Add(country);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(country));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,BirthDate,Weight,Height,PersonalBest,CountryId")] Jumper jumper)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jumper);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Name", jumper.CountryId);
            return(View(jumper));
        }