Example #1
0
        public static T GetDbContext()
        {
            IDbContextStorageContainer <T> container = DbContextStorageFactory <T> .CreateStorageContainer();

            var dbContext = container.GetDbContext();

            if (dbContext == null)
            {
                dbContext = new T();
                container.Store(dbContext);
            }
            return(dbContext as T);
        }
Example #2
0
        public static void ClearDbContext()
        {
            IDbContextStorageContainer <T> container = DbContextStorageFactory <T> .CreateStorageContainer();

            container.Clear();
        }