@@ -44,21 +44,12 @@ public DependencySetsViewModel(IEnumerable<PackageDependency> packageDependencie
4444 friendlyName = framework . ToFriendlyName ( ) ;
4545 }
4646
47- var dependencies = dependencySet . OrderBy ( x => x . Id ) . Select ( d => d . Id == null ? null : new DependencyViewModel ( d . Id , d . VersionSpec ) ) ;
47+ var dependencies = dependencySet . OrderBy ( x => x . Id , StringComparer . OrdinalIgnoreCase ) . Select ( d => d . Id == null ? null : new DependencyViewModel ( d . Id , d . VersionSpec ) ) ;
4848 frameworkGroups . Add ( ( tfmString , framework , friendlyName , dependencies ) ) ;
4949 }
5050
5151 // Sort by framework using NuGetFrameworkSorter, with null frameworks (All Frameworks) first
52- var sortedGroups = frameworkGroups . OrderBy ( g => g . framework ,
53- Comparer < NuGetFramework > . Create ( ( a , b ) =>
54- {
55- // Put "All Frameworks" (null) first
56- if ( a == null && b == null ) return 0 ;
57- if ( a == null ) return - 1 ;
58- if ( b == null ) return 1 ;
59- // Use NuGetFrameworkSorter for actual frameworks
60- return NuGetFrameworkSorter . Instance . Compare ( a , b ) ;
61- } ) ) ;
52+ var sortedGroups = frameworkGroups . OrderBy ( g => g . framework , new NullableFrameworkComparer ( ) ) ;
6253
6354 // Build the final dictionary with friendly names
6455 foreach ( var group in sortedGroups )
@@ -101,5 +92,18 @@ public DependencyViewModel(string id, string versionSpec)
10192 public string VersionSpec { get ; private set ; }
10293 public string PackageUrl { get ; private set ; }
10394 }
95+
96+ private class NullableFrameworkComparer : IComparer < NuGetFramework >
97+ {
98+ public int Compare ( NuGetFramework x , NuGetFramework y )
99+ {
100+ // Put "All Frameworks" (null) first
101+ if ( x == null && y == null ) return 0 ;
102+ if ( x == null ) return - 1 ;
103+ if ( y == null ) return 1 ;
104+ // Use NuGetFrameworkSorter for actual frameworks
105+ return NuGetFrameworkSorter . Instance . Compare ( x , y ) ;
106+ }
107+ }
104108 }
105109}
0 commit comments