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) ) ) )); }
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); }