Exemplo n.º 1
0
        /// <summary>
        /// Instantiates an Object Space that can be used to update the database.
        /// </summary>
        /// <param name="allowUpdateSchema"><b>true</b>, to allow schema updates; otherwise, <b>false</b>.</param>
        /// <returns>
        /// An <see cref="T:DevExpress.ExpressApp.IObjectSpace"/> object representing the instantiated Object Space that can be used to update the database.
        /// </returns>
        public IObjectSpace CreateUpdatingObjectSpace(Boolean allowUpdateSchema)
        {
            Guard.NotDisposed(this);
            IDisposable[] disposableObjects;
            IDataStore    dataStore;

            if (allowUpdateSchema || System.Diagnostics.Debugger.IsAttached /* BPOST */)
            {
                dataStore = dataStoreProvider.CreateUpdatingStore(out disposableObjects);
            }
            else
            {
                //dataStore = dataStoreProvider.CreateUpdatingStore(out disposableObjects);
                dataStore = dataStoreProvider.CreateWorkingStore(out disposableObjects);
            }
            UnitOfWork unitOfWork = CreateUnitOfWork(dataStore, disposableObjects);

            return(new ObjectSpace(unitOfWork, TypesInfo));
        }
Exemplo n.º 2
0
 public IDataStore CreateUpdatingStore(bool allowUpdateSchema, out IDisposable[] disposableObjects)
 {
     return(xpoDataStoreProvider.CreateUpdatingStore(allowUpdateSchema, out disposableObjects));
 }