Exemplo n.º 1
0
        protected async Task <IEnumerable <T> > GetListAsync(string partitionKey, string listKey, Func <ICacheEntry, Task <IEnumerable <T> > > factory)
        {
            var recordKey = $"{KeyPrefix}:ListOf{partitionKey}:{listKey}";
            var result    = await InnerCache.GetOrCreateAsync(recordKey, factory);

            UpdateIndex(partitionKey, recordKey);

            return(result);
        }
Exemplo n.º 2
0
        protected async Task <T> GetAsync(string partitionKey, string itemKey, Func <ICacheEntry, Task <T> > factory)
        {
            var recordKey = $"{KeyPrefix}:{partitionKey}:{itemKey}";
            var result    = await InnerCache.GetOrCreateAsync(recordKey, factory);

            UpdateIndex(partitionKey, recordKey);

            return(result);
        }