public void UpdateReseravtion(Reservation item)
 {
     using (RestaurantContext context = new RestaurantContext())
     {
         var attached = context.Reservations.Attach(item);
         var matchingWithExistingValues = context.Entry<Reservation>(attached);
         matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void DeleteReservation(Reservation item)
 {
     using (RestaurantContext context = new RestaurantContext())
     {
         var existing = context.Reservations.Find(item.EventCode);
         context.Reservations.Remove(existing);
         context.SaveChanges();
     }
 }
 public void AddReservation(Reservation item)
 {
     using (RestaurantContext context = new RestaurantContext())
     {
         var added = context.Reservations.Add(item);
         context.SaveChanges();
     }
 }