public async Task <IActionResult> Create([Bind("ID,LastName,FirstMidName,Email,EnrollmentDate")] Camper camper) { if (ModelState.IsValid) { camper.ID = Guid.NewGuid(); _context.Add(camper); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(camper)); }
public async Task <IActionResult> Create([Bind("ID,Title,Credits")] Course course) { if (ModelState.IsValid) { course.ID = Guid.NewGuid(); _context.Add(course); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(course)); }