You can use SortedSet<T>: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.sortedset-1?view=net-8.0
SortedSet<T>