public IActionResult Form(Appointment appointment) { // If this appointment matches the ModelState, push to database if (ModelState.IsValid) { _context.Add(appointment); _context.SaveChanges(); return(RedirectToAction("ViewAppointments")); } // Else return user to form page to fix errors return(View(appointment)); }
public void InsertTourKind(TourKind tourKind) { _db.TourKinds.Add(tourKind); _db.SaveChanges(); }