public void Add(BookedItem entity) { using (var dbContext = new PoREntities(ConnectionString)) { dbContext.BookedItems.Add(entity); dbContext.SaveChanges(); } }
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(); } }
public void Delete(BookedItem entity) { DeleteItem(entity.BookedItemId); }