Exemplo n.º 1
0
 private static void RollbackTransactions() {
     using(IObjectContainer container = OpenDatabase())
     {
         var toyota = new Car("Toyota Corolla");
         var jimmy = new Driver("Jimmy", toyota);
         container.Store(jimmy);
         // #example: Rollback changes
         container.Rollback();
         // #end example
     } 
 }
Exemplo n.º 2
0
    private static void StoreExampleObjects() {
        using(IObjectContainer container = OpenDatabase())
        {
            var vwBeetle = new Car("VW Beetle");
            var audi = new Car("Audi A6");
            var ferrari = new Car("Ferrari");

            var joe = new Driver("Joe", audi);
            var joanna = new Driver("Joanna", vwBeetle);
            var jenny = new Driver("Jenny");
            var john = new Driver("John", ferrari);
            var jim = new Driver("Jim", audi);

            container.Store(joe);
            container.Store(joanna);
            container.Store(jenny);
            container.Store(john);
            container.Store(jim);
        } 
    }