public async Task <IActionResult> Create([Bind("ID,Name,InstructorID,Duration,Date")] Class @class) { if (ModelState.IsValid) { _context.Add(@class); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(@class)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,Surname,DateOfBirth")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Create([Bind("ID,Name,DateOfBirth")] Instructor instructor) { if (ModelState.IsValid) { _context.Add(instructor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(instructor)); }