﻿using System.Collections.Generic;
using System.Linq;

namespace NuGet.VisualStudio {
    public static class AggregatePackageSource {
        public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName);

        public static bool IsAggregate(this PackageSource source) {
            return source == Instance;
        }

        public static IEnumerable<PackageSource> GetPackageSourcesWithAggregate(this IPackageSourceProvider provider) {
            return Enumerable.Repeat(Instance, 1).Concat(provider.LoadPackageSources());
        }

        public static IEnumerable<PackageSource> GetPackageSourcesWithAggregate() {
            return GetPackageSourcesWithAggregate(ServiceLocator.GetInstance<IVsPackageSourceProvider>());
        }
    }
}
﻿using System.Collections.Generic;
using System.Linq;

namespace NuGet.VisualStudio {
    public static class AggregatePackageSource {
        public static readonly PackageSource Instance = new PackageSource("(Aggregate source)", Resources.VsResources.AggregateSourceName);

        public static bool IsAggregate(this PackageSource source) {
            return source == Instance;
        }

        public static IEnumerable<PackageSource> GetPackageSourcesWithAggregate(this IPackageSourceProvider provider) {
            return new[] { Instance }.Concat(provider.LoadPackageSources());
        }

        public static IEnumerable<PackageSource> GetPackageSourcesWithAggregate() {
            return GetPackageSourcesWithAggregate(ServiceLocator.GetInstance<IVsPackageSourceProvider>());
        }
    }
}
Replace Enumerable.Repeat call with an one-element array.
Replace Enumerable.Repeat call with an one-element array.
