public void Usage() { ObjectContainer db4oContainer = (ObjectContainer)Container["db4o.container"]; Assert.IsNotNull(db4oContainer); Guid id = Guid.NewGuid(); try { db4oContainer.Set(new Beer(id)); } catch { db4oContainer.Rollback(); } finally { db4oContainer.Commit(); } ObjectSet results = db4oContainer.Get(typeof(Beer)); Assert.AreEqual(1, results.Size()); Beer loaded = (Beer)results.Next(); Assert.AreEqual(id, loaded.Id); db4oContainer.Delete(loaded); db4oContainer.Commit(); results = db4oContainer.Get(typeof(Beer)); Assert.AreEqual(0, results.Size()); }
public virtual void Remove(Beer beer) { _objContainer.Delete(beer); }
public override void Delete(TEntity entity) { ObjectContainer.Delete(entity); }