示例#1
0
        public override async Task <Tuple <bool, INuGetResource> > TryCreate(SourceRepository source, CancellationToken token)
        {
            RepositorySignatureResource resource = null;
            var serviceIndex = await source.GetResourceAsync <ServiceIndexResourceV3>(token);

            if (serviceIndex != null)
            {
                var serviceEntry = serviceIndex.GetServiceEntries(ServiceTypes.RepositorySignatures).FirstOrDefault();

                if (serviceEntry != null)
                {
                    resource = await GetRepositorySignatureResourceAsync(source, serviceEntry, NullLogger.Instance, token);
                }
            }

            return(new Tuple <bool, INuGetResource>(resource != null, resource));
        }
        public override async Task <Tuple <bool, INuGetResource> > TryCreate(SourceRepository source, CancellationToken token)
        {
            RepositorySignatureResource resource = null;
            var serviceIndex = await source.GetResourceAsync <ServiceIndexResourceV3>(token);

            if (serviceIndex != null)
            {
                var repoSignUrl = serviceIndex.GetServiceEntryUri(ServiceTypes.RepositorySignatures);

                if (repoSignUrl != null)
                {
                    resource = await GetRepositorySignatureResourceAsync(source, repoSignUrl.AbsoluteUri, NullLogger.Instance, token);
                }
            }

            return(new Tuple <bool, INuGetResource>(resource != null, resource));
        }