From 528bcb1d6ae09821f47b3f35634e7f70fbf1a789 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Wed, 23 Mar 2016 20:49:57 -0500 Subject: [PATCH] (GH-668) Search should sort by version desc When searching against multiple versions, the search order should be by id, then by version descending. This returns the results in the correct order for folks to install. --- src/chocolatey/infrastructure.app/nuget/NugetList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/nuget/NugetList.cs b/src/chocolatey/infrastructure.app/nuget/NugetList.cs index e7b39ef54b..312b649aa7 100644 --- a/src/chocolatey/infrastructure.app/nuget/NugetList.cs +++ b/src/chocolatey/infrastructure.app/nuget/NugetList.cs @@ -87,11 +87,11 @@ private static IQueryable execute_package_search(ChocolateyConfigurati { if (isRemote) { - return results.OrderBy(p => p.Id); + return results.OrderBy(p => p.Id).ThenByDescending(p => p.Version); } else { - return results.Where(PackageExtensions.IsListed).OrderBy(p => p.Id).AsQueryable(); + return results.Where(PackageExtensions.IsListed).OrderBy(p => p.Id).ThenByDescending(p => p.Version).AsQueryable(); } }