Ejemplo n.º 1
0
        public async Task <Unit> Handle(ClearCacheCommand request, CancellationToken cancellationToken)
        {
            await cacheRepository.Clear();

            await poeNinjaRepository.Clear();

            return(Unit.Value);
        }
Ejemplo n.º 2
0
        public static void FillCache(string xmlPath, ICacheRepository cacheRepository)
        {
            var parser = new XmlParser(xmlPath);
            var modules = parser.ParseXml();
            var tableOfContents = new TableOfContents(modules);

            cacheRepository.Clear();

            // By convention, the table of contents is always situated at Guid.Empty.
            cacheRepository.Put(CourseService.TableOfContentsKey, tableOfContents);
            foreach (var lesson in modules.SelectMany(x => x.Lessons))
                cacheRepository.Put(lesson.Id, lesson);
        }
Ejemplo n.º 3
0
        public static void FillCache(string xmlPath, ICacheRepository cacheRepository)
        {
            var parser          = new XmlParser(xmlPath);
            var modules         = parser.ParseXml();
            var tableOfContents = new TableOfContents(modules);

            cacheRepository.Clear();

            // By convention, the table of contents is always situated at Guid.Empty.
            cacheRepository.Put(CourseService.TableOfContentsKey, tableOfContents);
            foreach (var lesson in modules.SelectMany(x => x.Lessons))
            {
                cacheRepository.Put(lesson.Id, lesson);
            }
        }
Ejemplo n.º 4
0
 public void Clear()
 {
     _layer2Repository.Clear();
     _layer1Repository.Clear();
     Publish(default(TKey));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Clear the Cache
 /// </summary>
 /// <exception cref="T:NHibernate.Cache.CacheException"/>
 public void Clear()
 {
     Repository.Clear();
 }
 public void Clear()
 {
     _cacheRepo.Clear();
 }
        // EntityのOnSubmitのコールバック用に、cacheをクリアする関数を返す
        private Func <Task> ClearCacheOnSubmit(DbContext dbContext, TEntity entity)
        {
            var keys = dbContext.FindPrimaryKeyValues(entity);

            return(() => cacheRepository.Clear(keys));
        }
 public void Clear()
 {
     _cacheRepository.Clear();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 비동기 방식으로 캐시에 저장된 모든 정보를 삭제합니다.
 /// </summary>
 /// <param name="repository"></param>
 /// <returns></returns>
 public static Task ClearAsync(this ICacheRepository repository)
 {
     return(Task.Factory.StartNew(() => repository.Clear()));
 }