public void DeleteWaiter(Waiter item)
 {
     using (RestrauntContext context = new RestrauntContext())
     {
         var existing = context.Waiters.Find(item.WaiterID);
         context.Waiters.Remove(existing);
         context.SaveChanges();
     }
 }
 public int AddWaiter(Waiter item)
 {
     using (RestrauntContext context = new RestrauntContext())
     {
         // TODO: Validation of waiter data...
         var added = context.Waiters.Add(item);
         context.SaveChanges();
         return(added.WaiterID);
     }
 }
 public void UpdateWaiter(Waiter item)
 {
     using (RestrauntContext context = new RestrauntContext())
     {
         // TODO: Validation
         var attatched = context.Waiters.Attach(item);
         var matchingWithExistingValues = context.Entry <Waiter>(attatched);
         matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }