public async Task <IActionResult> Create([Bind("StudentID,UserName,FirstName,LastName,PhoneNumber,Address,Password,IsAdmin")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("CourseID,CourseName,Category")] Course course) { if (ModelState.IsValid) { _context.Add(course); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(course)); }
public async Task <IActionResult> Create([Bind("EnrollmentID,EnrollmentDate,FinalGrade")] Enrollment enrollment) { if (ModelState.IsValid) { _context.Add(enrollment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(enrollment)); }