private static void SetupDatabase(DynamicContextProvider dynamicProvider) { using (var ctx = dynamicProvider.GetContext()) { RecreateDatabase(ctx); AddSomeContacts(ctx); } }
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(); }