Exemple #1
0
        public override async Task <INuGetResource> Create(SourceRepository source)
        {
            INuGetResource   resource = null;
            DownloadResource v2DownloadResource;

            if (!_cache.TryGetValue(source.PackageSource, out v2DownloadResource))
            {
                resource = await base.Create(source);

                if (resource != null)
                {
                    v2DownloadResource = new V2DownloadResource((V2Resource)resource);
                    _cache.TryAdd(source.PackageSource, v2DownloadResource);
                    resource = v2DownloadResource;
                }
                else
                {
                    resource = null;
                }
            }
            else
            {
                resource = v2DownloadResource;
            }

            return(resource);
        }
 public override async Task<Resource> Create(PackageSource source)
 {
     var resource = await base.Create(source);
     if (resource != null)
     {
         var v2DownloadResource = new V2DownloadResource((V2Resource)resource);
         return v2DownloadResource;
     }
     else
     {
         return null;
     }
 }
        public override async Task <Resource> Create(PackageSource source)
        {
            var resource = await base.Create(source);

            if (resource != null)
            {
                var v2DownloadResource = new V2DownloadResource((V2Resource)resource);
                return(v2DownloadResource);
            }
            else
            {
                return(null);
            }
        }