コード例 #1
0
 private static void SetupDatabase(DynamicContextProvider dynamicProvider)
 {
     using (var ctx = dynamicProvider.GetContext())
     {
         RecreateDatabase(ctx);
         AddSomeContacts(ctx);
     }
 }
コード例 #2
0
        static void Main()
        {
            var staticProvider = new StaticContextProvider(Settings.Default.ConnectionString);

            var dynamicProvider = new DynamicContextProvider(Settings.Default.ConnectionString);

            SetupDatabase(dynamicProvider);

            TimeTest("Test A - use caching", () => RunTest(staticProvider));

            TimeTest("Test B - no caching", () => RunTest(dynamicProvider));

            Console.WriteLine("Done");
            Console.Read();
        }