public async Task <IActionResult> Create([Bind("StaffEntityId,Firstname,Lastname,Email")] StaffEntity staffEntity) { if (ModelState.IsValid) { _context.Add(staffEntity); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(staffEntity)); }
public async Task <IActionResult> Create([Bind("TicketId,Price,StaffEntityId")] Ticket ticket) { if (ModelState.IsValid) { _context.Add(ticket); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StaffEntityId"] = new SelectList(_context.StaffEntities, "StaffEntityId", "Email", ticket.StaffEntityId); return(View(ticket)); }