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

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

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

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

            if (resource != null)
            {
                var v2MetadataResource = new V2MetadataResource((V2Resource)resource);
                return(v2MetadataResource);
            }
            else
            {
                return(null);
            }
        }