public async Task <IActionResult> Create([Bind("StudentId,StudentNumber,FirstName,LastName,Email")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("TaskId,TaskName,DueDate,CompleteStatus,StudentNumber")] Task task) { if (ModelState.IsValid) { _context.Add(task); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StudentNumber"] = new SelectList(_context.Student, "StudentNumber", "StudentNumber", task.StudentNumber); return(View(task)); }