Exemple #1
0
 protected override IObjectContextAsync CreateContext()
 {
     if (provider == null)
     {
         provider = new OData.ODataPersistenceProvider();
         provider.ConnectionString = new Uri("http://localhost:37770/Common.svc/");
         provider.Initialized += ((AsyncUnitTestHarness)UnitTestHarness).EventRunDispatcher.DispatchRun;
         provider.EnsureConfigurationInitialized();
     }
     else if (provider.Metadata != null)
     {
         ((AsyncUnitTestHarness)UnitTestHarness).EventRunDispatcher.DispatchRun();
     }
     os = new ObjectService(provider);
     os.ObjectContextType = typeof(EntityResolver.Proxy.Dynamic.ObjectContextAsync).AssemblyQualifiedName;
     return os.CreateAsyncObjectContext();
 }