private static void StoreExampleObjects() { using (IObjectContainer container = Db4oEmbedded.OpenFile(DatabaseFile)) { // #example: Store a driver and his cars var beetle = new Car("VW Beetle"); var ferrari = new Car("Ferrari"); var driver = new Driver("John", ferrari) { OwnedCars = new List<Car> {beetle, ferrari} }; container.Store(driver); // #end example } }
public void AddOwnedCar(Car item) { ownedCars.Add(item); }
public Driver(string name,Car mostLovedCar) { this.name = name; this.mostLovedCar = mostLovedCar; }