A SQL-specific implementation of an IDaLayer. Provided functionality to run data access function that are specific to data sources that take sql commands.
Inheritance: AbstractDaLayer
Example #1
0
 private static void AssertPerformance(object input, Type desiredType, int loopCount, TimeSpan max)
 {
     int retryCount = 3;
     DateTime startMine;
     DateTime endMine;
     do
     {
         SqlDaLayer coercer = new SqlDaLayer(null, true);
         startMine = DateTime.Now;
         for (int x = 0; x < loopCount; x++)
         {
             coercer.CoerceType(desiredType, input);
         }
         endMine = DateTime.Now;
         Console.WriteLine("time to convert " + input + ": " + (endMine - startMine) + " (attempt " + (4 - retryCount) + ")");
         // Since this test randomly fails, retry a couple times before giving up.
         if (endMine - startMine < max)
         {
             retryCount = 0;
         }
         else
         {
             retryCount--;
         }
     } while (retryCount > 0);
     Assert.Less(endMine - startMine, max, "took too long!  Input: " +
         input + ", type: " + desiredType);
 }