コード例 #1
0
 protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args)
 {
     provider = new FeatureCenterXpoDataStoreProvider();
     args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(provider, true));
     provider.Initialize(
         String.Format(@"XpoProvider=InMemoryDataStore; Read Only=True; Data Source={0}nwind.xml", AppDomain.CurrentDomain.SetupInformation.ApplicationBase),
         GetConnectionString());
     args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
 }
コード例 #2
0
 protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args)
 {
     if (provider == null)
     {
         lock (CreateDefaultObjectSpaceProviderLockObject) {
             if (provider == null)
             {
                 try {
                     provider = new FeatureCenter.Module.FeatureCenterXpoDataStoreProvider();
                     provider.Initialize(
                         string.Format(@"XpoProvider=InMemoryDataStore; Read Only=True; Data Source={0}\App_Data\nwind.xml", AppDomain.CurrentDomain.SetupInformation.ApplicationBase),
                         GetConnectionString());
                 }
                 catch {
                     provider = null;
                     throw;
                 }
             }
         }
     }
     args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(provider));
     args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
 }