Пример #1
0
        protected virtual async Task <LanguageConfig> GetLanguageListAsync(IDocumentStore store, Project project, string version)
        {
            async Task <LanguageConfig> GetLanguagesAsync()
            {
                return(await store.GetLanguageListAsync(project, version));
            }

            return(await LanguageCache.GetOrAddAsync(
                       project.ShortName,
                       GetLanguagesAsync,
                       () => new DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(24)
            }
                       ));
        }