public async Task <IFileReferenceResponse> GetFileReferenceAsync(IFileReferenceRequest request, CancellationToken token)
        {
            request.EnsureNotNull();

            return(FileReferenceResponseFactory.CreateFileReferenceResponse
                   (
                       FileReferenceFactory.Create
                       (
                           await _cachingService.AddOrGetExistingAsync
                           (
                               request.FileReferenceId,
                               request.CacheRegion,
                               () => _graphQLService.GetFileReferenceAsync(request.FileReferenceId, token)
                           )
                       )
                   ));
        }
示例#2
0
        public async Task <FileReferencesResponse> GetFileReferenceAsync(FileReferencesRequest request)
        {
            if (request is null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var result = await _cache.AddOrGetExistingAsync
                         (
                request.Key,
                () =>
            {
                return(_graphQLService.GetFileReferenceAsync(request.FileReferenceId, request.PagingOptions));
            }
                         );

            return(result.Data);
        }