<commit_before>using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;

namespace NuGet.Dialog.Providers {

    /// <summary>
    /// This class represents a tree node under the Updates tab
    /// </summary>
    internal class UpdatesTreeNode : SimpleTreeNode {
        private readonly IPackageRepository _localRepository;

        public UpdatesTreeNode(
            PackagesProviderBase provider,
            string category,
            IVsExtensionsTreeNode parent,
            IPackageRepository localRepository,
            IPackageRepository sourceRepository) :
            base(provider, category, parent, sourceRepository) {

            _localRepository = localRepository;
        }

        public override IQueryable<IPackage> GetPackages() {
            return Repository.GetUpdates(_localRepository.GetPackages()).AsQueryable();
        }
    }
}<commit_msg>Turn the updates enumerable into a list before returning it so Count doesn't cause another query to the server. Work items: 1200<commit_after>using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;

namespace NuGet.Dialog.Providers {

    /// <summary>
    /// This class represents a tree node under the Updates tab
    /// </summary>
    internal class UpdatesTreeNode : SimpleTreeNode {
        private readonly IPackageRepository _localRepository;

        public UpdatesTreeNode(
            PackagesProviderBase provider,
            string category,
            IVsExtensionsTreeNode parent,
            IPackageRepository localRepository,
            IPackageRepository sourceRepository) :
            base(provider, category, parent, sourceRepository) {

            _localRepository = localRepository;
        }

        public override IQueryable<IPackage> GetPackages() {
            return Repository.GetUpdates(_localRepository.GetPackages())
                             .ToList()
                             .AsQueryable();
        }
    }
}
{'fraction_non_alphanumeric': 0.06646216768916155, 'fraction_numerical': 0.002044989775051125, 'mean_word_length': 2.4454225352112675, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1563508', 'n_tokens_mistral': 462, 'n_tokens_neox': 443, 'n_words': 123}