예제 #1
0
        public static void Clear()
        {
            var dataContextStorageContainer =
                DataContextStorageFactory <ConnectedEntities> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
        /// <summary>
        /// </summary>
        public static void ClearDataContext()
        {
            var dataContextStorageContainer =
                DataContextStorageFactory <AppDbContext> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
예제 #3
0
        /// <summary>
        ///     Clear out the current ContactManagerContext
        /// </summary>
        public static void Clear()
        {
            IDataContextStorageContainer <MainDataContext> dataContextStorageContainer =
                DataContextStorageFactory <MainDataContext> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
예제 #4
0
        /// <summary>
        /// Retrieves an instance of ContactManagerContext from the appropriate storage container or
        /// creates a new instance and stores that in a container.
        /// </summary>
        /// <returns>An instance of ContactManagerContext.</returns>
        public static ContactManagerContext GetDataContext()
        {
            var dataContextStorageContainer = DataContextStorageFactory <ContactManagerContext> .CreateStorageContainer();

            var contactManagerContext = dataContextStorageContainer.GetDataContext();

            if (contactManagerContext == null)
            {
                contactManagerContext = new ContactManagerContext();
                dataContextStorageContainer.Store(contactManagerContext);
            }
            return(contactManagerContext);
        }
예제 #5
0
        /// <summary>
        /// Retrieves an instance of GatewayMgmtContext from the appropriate storage container or
        /// creates a new instance and stores that in a container.
        /// </summary>
        /// <returns>An instance of GatewayMgmtContext.</returns>
        public static GatewayMgmtContext GetDataContext()
        {
            var dataContextStorageContainer = DataContextStorageFactory <GatewayMgmtContext> .CreateStorageContainer();

            var dataContext = dataContextStorageContainer.GetDataContext();

            if (dataContext == null)
            {
                dataContext = new GatewayMgmtContext();
                dataContextStorageContainer.Store(dataContext);
            }
            return(dataContext);
        }
        public static InsuranceAppContext GetDataContext()
        {
            var dataContextStorageContainer = DataContextStorageFactory <InsuranceAppContext> .CreateStorageContainer();

            var insuranceAppContext = dataContextStorageContainer.GetDataContext();

            if (insuranceAppContext == null)
            {
                insuranceAppContext = new InsuranceAppContext();
                dataContextStorageContainer.Store(insuranceAppContext);
            }
            return(insuranceAppContext);
        }
예제 #7
0
        public static JamimDataContext GetDataContext()
        {
            IDataContextStorageContainer _dataContextStorageContainer = DataContextStorageFactory.CreateStorageContainer();

            JamimDataContext jamimDataContext = _dataContextStorageContainer.GetDataContext();

            if (jamimDataContext == null)
            {
                jamimDataContext = new JamimDataContext();
                _dataContextStorageContainer.Store(jamimDataContext);
            }
            return(jamimDataContext);
        }
예제 #8
0
        public static LibraryDataContext GetCurrentDataContext()
        {
            IDataContextStorageContainer storageContainer = DataContextStorageFactory.GetStorageContainer();
            LibraryDataContext           dataContext      = storageContainer.GetDataContext();

            if (dataContext == null)
            {
                dataContext = new LibraryDataContext();
                storageContainer.Store(dataContext);
            }

            return(dataContext);
        }
        public static PrincipalDBContainer GetDataContext()
        {
            var dataContextStorageContainer = DataContextStorageFactory <PrincipalDBContainer> .CreateStorageContainer();

            var contactManagerContext = dataContextStorageContainer.GetDataContext();

            if (contactManagerContext == null)
            {
                contactManagerContext = new PrincipalDBContainer();
                dataContextStorageContainer.Store(contactManagerContext);
            }
            return(contactManagerContext);
        }
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public static AppDbContext GetDataContextAsync()
        {
            var dataContextStorageContainer =
                DataContextStorageFactory <AppDbContext> .CreateStorageContainer();

            var contactManagerContext = dataContextStorageContainer.GetDataContext();

            if (contactManagerContext == null)
            {
                contactManagerContext = new AppDbContext("SimpleMembership");
                dataContextStorageContainer.Store(contactManagerContext);
            }
            return(contactManagerContext);
        }
        /// <summary>
        /// 获取上下文
        /// </summary>
        /// <returns></returns>
        public static ModelBaseContext GetDataContext()
        {
            IDataContextStorageContainer _dataContextStorageContainer = DataContextStorageFactory.CreateStorageContainer();

            ModelBaseContext libraryDataContext = _dataContextStorageContainer.GetDataContext();

            if (libraryDataContext == null)
            {
                libraryDataContext = new ModelBaseContext(new DbContextOptions <ModelBaseContext>());
                _dataContextStorageContainer.Store(libraryDataContext);
            }

            return(libraryDataContext);
        }
        public static MegaMediaManagerContext GetDataContext()
        {
            var dataContextStorageContainer =
                DataContextStorageFactory <MegaMediaManagerContext> .CreateStorageContainer();

            var context = dataContextStorageContainer.GetDataContext();

            if (context == null)
            {
                context = MegaMediaManagerContext.Create();
                dataContextStorageContainer.Store(context);
            }
            return(context);
        }
예제 #13
0
        /// <summary>
        ///     Retrieves an instance of EssContext from the appropriate storage container or
        ///     creates a new instance and stores that in a container.
        /// </summary>
        /// <returns>An instance of EssContext.</returns>
        public static MainDataContext GetDataContext()
        {
            IDataContextStorageContainer <MainDataContext> dataContextStorageContainer =
                DataContextStorageFactory <MainDataContext> .CreateStorageContainer();

            MainDataContext context = dataContextStorageContainer.GetDataContext();

            if (context == null)
            {
                context = new MainDataContext();
                dataContextStorageContainer.Store(context);
            }
            return(context);
        }
        public static LibraryDataContext GetDataContext()
        {
            IDataContextStorageContainer _dataContextStorageContainer = DataContextStorageFactory.CreateStorageContainer();

            LibraryDataContext libraryDataContext = _dataContextStorageContainer.GetDataContext();

            if (libraryDataContext == null)
            {
                libraryDataContext = new LibraryDataContext();
                _dataContextStorageContainer.Store(libraryDataContext);
            }

            return(libraryDataContext);
        }
        public static LibraryDataContext GetDataContext()
        {
            //由工厂方法获取贮藏存储对象
            IDataContextStorageContainer _dataContextStorageContainer = DataContextStorageFactory.CreateStorageContainer();

            //由于贮藏存储对象实现了指定接口,即实现了GetDataContext方法,调用该方法获取上下文对象
            LibraryDataContext libraryDataContext = _dataContextStorageContainer.GetDataContext();

            if (libraryDataContext == null)
            {
                libraryDataContext = new LibraryDataContext();
                _dataContextStorageContainer.Store(libraryDataContext);
            }

            return(libraryDataContext);
        }
예제 #16
0
        public static ApplicationDbContext GetDataContext()
        {
            var dataContextStorageContainer = DataContextStorageFactory <ApplicationDbContext> .CreateStorageContainer();

            var applicationContext = dataContextStorageContainer.GetDataContext();

            if (applicationContext != null)
            {
                return(applicationContext);
            }

            applicationContext = new ApplicationDbContext();
            dataContextStorageContainer.Store(applicationContext);

            return(applicationContext);
        }
예제 #17
0
        public static HXContext GetDataContext()
        {
            IDataContextStorageContainer _dataContextStorageContainer = DataContextStorageFactory.CreateStorageContainer();
            HXContext hxContext = _dataContextStorageContainer.GetDataContext();

            if (hxContext == null)
            {
                hxContext = new HXContext();
            }
            else
            {
                hxContext = new HXContext();
                _dataContextStorageContainer.Store(hxContext);
            }
            return(hxContext);
        }
        public static void Clear()
        {
            var dataContextStorageContainer = DataContextStorageFactory <InsuranceAppContext> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
예제 #19
0
        /// <summary>
        /// Clears out the current GatewayMgmtContext.
        /// </summary>
        public static void Clear()
        {
            var dataContextStorageContainer = DataContextStorageFactory <GatewayMgmtContext> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
예제 #20
0
        /// <summary>
        /// Clears out the current ContactManagerContext.
        /// </summary>
        public static void Clear()
        {
            var dataContextStorageContainer = DataContextStorageFactory <ContactManagerContext> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }
        public static void Clear()
        {
            var dataContextStorageContainer = DataContextStorageFactory <PrincipalDBContainer> .CreateStorageContainer();

            dataContextStorageContainer.Clear();
        }