public void GenerateKeyGenratesUniqueKeysForSameExpressionOnDifferentTablesInLinqToSql()
        {
            using (var context = new LinqToSqlContext(TestDatabase.ConnectionString))
            {
                var key1 = ExpressionKeyGenerator.GetKey(context.TestTable1s.Where(row => row.Column == "test").Expression);
                var key2 = ExpressionKeyGenerator.GetKey(context.TestTable2s.Where(row => row.Column == "test").Expression);

                Assert.AreNotEqual(key1, key2);
            }
        }
Exemplo n.º 2
0
 public void Uncached()
 {
     using (var context = new LinqToSqlContext(TestDatabase.ConnectionString))
     {
         var watch = Stopwatch.StartNew();
         for (var repeats = 0; repeats <= 10000; repeats++)
         {
             context.TestTable1s.Where(t => t.Column == "Test").ToList();
         }
         Trace.WriteLine("Performed 10000 iterations in " + watch.ElapsedMilliseconds + "ms. Average speed: " + (int)(10000 / watch.Elapsed.TotalSeconds) + " iterations/second.");
     }
 }