Exemple #1
0
        public void UpdateConflictTest()
        {
#if NETFX
            using (new TransactionHelper())
            {
                Concurrency.DatabaseWins(new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()));
            }
            using (new TransactionHelper())
            {
                Concurrency.ClientWins(new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()));
            }
            using (new TransactionHelper())
            {
                Concurrency.MergeClientAndDatabase(new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()), new DbReaderWriter(new AdventureWorks()));
            }
            using (new TransactionHelper())
            {
                Concurrency.SaveChanges(new AdventureWorks(), new AdventureWorks());
            }
#else
            Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
                     Concurrency.DatabaseWins(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
            Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
                     Concurrency.ClientWins(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
            Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
                     Concurrency.MergeClientAndDatabase(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
            Rollback((adventureWorks1, adventureWorks2) =>
                     Concurrency.SaveChanges(adventureWorks1, adventureWorks2));
#endif
        }
Exemple #2
0
 public void UpdateConflictTest()
 {
     Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
              Concurrency.DatabaseWins(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
     Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
              Concurrency.ClientWins(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
     Rollback((adventureWorks1, adventureWorks2, adventureWorks3) =>
              Concurrency.MergeClientAndDatabase(new DbReaderWriter(adventureWorks1), new DbReaderWriter(adventureWorks2), new DbReaderWriter(adventureWorks3)));
     Rollback((adventureWorks1, adventureWorks2) =>
              Concurrency.SaveChanges(adventureWorks1, adventureWorks2));
 }
Exemple #3
0
 public void UpdateConflictTest()
 {
     using (new TransactionScope())
     {
         Concurrency.UpdateProductDatabaseWins();
     }
     using (new TransactionScope())
     {
         Concurrency.UpdateProductClientWins();
     }
     using (new TransactionScope())
     {
         Concurrency.UpdateProductMergeClientAndDatabase();
     }
     using (new TransactionScope())
     {
         Concurrency.SaveChanges();
     }
 }