Exemple #1
0
 public void Add(BookedItem entity)
 {
     using (var dbContext = new PoREntities(ConnectionString))
     {
         dbContext.BookedItems.Add(entity);
         dbContext.SaveChanges();
     }
 }
Exemple #2
0
 public void Update(BookedItem entity)
 {
     using (var dbContext = new PoREntities(ConnectionString))
     {
         // We could turn this into an upsert
         dbContext.BookedItems.Attach(entity);
         dbContext.Entry(entity).State = EntityState.Modified;
         dbContext.SaveChanges();
     }
 }
Exemple #3
0
 public void Delete(BookedItem entity)
 {
     DeleteItem(entity.BookedItemId);
 }