private static void MakeAndStoreTwoItemsInTwoContainers(IEmbeddedObjectContainer objectContainer, int seriesNumber) { var evenIndex = 2 * seriesNumber; var oddIndex = 1 + evenIndex; var fred = new Container {Name = String.Format("Fred_{0}", evenIndex)}; var itemOne = new Item {Name = String.Format("Odd_{0}", oddIndex)}; var itemTwo = new Item {Name = String.Format("Even_{0}", evenIndex)}; itemOne.Container = fred; itemTwo.Container = fred; { objectContainer.Store(itemOne); objectContainer.Commit(); var ethel = new Container {Name = String.Format("Ethel_{0}", evenIndex)}; var oldContainer = itemTwo.Container; itemTwo.Container = ethel; if (oldContainer != fred) { throw new Exception("No!"); } if (oldContainer.Items.Count() != 1) { throw new Exception("No"); } objectContainer.Store(oldContainer); objectContainer.Store(itemTwo); } }
public Task SaveChanges() { return(Task.Run(() => _container.Commit())); }
public void Save(DtoLicensePlateInfo licensePlateInfo) { _db4oContainer.Store(licensePlateInfo); _db4oContainer.Commit(); }
public void CommitTransaction() { _db.Commit(); _db.Close(); }