public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,Adress,PhoneNumber,Weight,PostitionID,IsActif")] Pilot pilot) { if (ModelState.IsValid) { _context.Add(pilot); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pilot)); }
public async Task <IActionResult> Create([Bind("ID,Name,PilotID")] Role role) { if (ModelState.IsValid) { _context.Add(role); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PilotID"] = new SelectList(_context.Pilots, "ID", "FirstName", role.PilotID); return(View(role)); }