コード例 #1
0
        /// <summary>
        /// removes all items from a cache region
        /// </summary>
        /// <param name="region"></param>
        /// <returns></returns>
        public async override Task <bool> RemoveAll(string region)
        {
            if (!_isEnabled)
            {
                return(true);
            }

            var mongoDatabase = MongoUtilities.GetDatabaseFromUrl(new MongoUrl(_mongoConnectionString));
            await Task.Factory.StartNew(() => mongoDatabase.DropCollection(region));

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// removes all items from cache from all regions
        /// </summary>
        /// <returns></returns>
        public async override Task <bool> RemoveAll()
        {
            if (!_isEnabled)
            {
                return(true);
            }

            await
            Task.Factory.StartNew(
                () => MongoUtilities.GetDatabaseFromUrl(new MongoUrl(_mongoConnectionString)).Drop());

            return(true);
        }