Exemplo n.º 1
0
        /// <summary>
        /// Instantiates an Object Space.
        /// </summary>
        /// <returns>
        /// An <see cref="T:DevExpress.ExpressApp.IObjectSpace"/> object representing the instantiated Object Space.
        /// </returns>
        public IObjectSpace CreateObjectSpace()
        {
            Guard.NotDisposed(this);
            if (workingDataStore == null)
            {
                workingDataStoreDisposableObjects = null;
                workingDataStore = dataStoreProvider.CreateWorkingStore(out workingDataStoreDisposableObjects);
            }
            if (workingDataLayer == null)
            {
                workingDataLayer = CreateWorkingDataLayer(workingDataStore);
            }
            var unitOfWork = new UnitOfWork(workingDataLayer);

            return(CreateObjectSpaceCore(unitOfWork, TypesInfo));
        }
Exemplo n.º 2
0
 public IDataStore CreateWorkingStore(out IDisposable[] disposableObjects)
 {
     if (root == null)
     {
         IDataStore baseDataStore = xpoDataStoreProvider.CreateWorkingStore(out rootDisposableObjects);
         root = new DataCacheRoot(baseDataStore);
     }
     disposableObjects = new IDisposable[0];
     return(new DataCacheNode(root));
 }
        public IDataStore CreateWorkingStore(out IDisposable[] disposableObjects)
        {
            IDataStore ds = innerDataStoreProvider.CreateWorkingStore(out disposableObjects);

            if (ds is ConnectionProviderSql connectionProvider)
            {
                connectionProvider.DefaultCommandTimeout = new TimeSpan(0, 5, 0).Milliseconds;
            }
            return(ds);
        }