public ActionResult Create(Reservation reservation)
 {
     if (ModelState.IsValid) {
         reservationRepository.InsertOrUpdate(reservation);
         reservationRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossiblePlaygrounds = playgroundRepository.All;
         ViewBag.PossibleReservedBies = customerprofileRepository.All;
         return View();
     }
 }
 public void InsertOrUpdate(Reservation reservation)
 {
     if (reservation.ReservationId == default(int)) {
         // New entity
         context.Reservations.Add(reservation);
     } else {
         // Existing entity
         context.Entry(reservation).State = EntityState.Modified;
     }
 }