public async Task <IActionResult> Create([Bind("Id,Name,Author,ReleaseDate")] Competition competition) { if (ModelState.IsValid) { _context.Add(competition); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(competition)); }
public async Task <IActionResult> Create([Bind("Id,Name,Salary,WorkExperience")] Trainer trainer) { if (ModelState.IsValid) { _context.Add(trainer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(trainer)); }
public async Task <IActionResult> Create([Bind("Id,Name,Position,TeamId")] Player player) { if (ModelState.IsValid) { _context.Add(player); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TeamId"] = new SelectList(_context.Team, "Id", "Id", player.TeamId); return(View(player)); }
public async Task <IActionResult> Create([Bind("Id,Name,Budget,TrainerId")] Team team) { if (ModelState.IsValid) { _context.Add(team); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TrainerId"] = new SelectList(_context.Trainer, "Id", "Id", team.TrainerId); return(View(team)); }