Quantcast
Channel: .NET 5.0 breaking changes regarding `IEnumerable.OrderBy` behavior on string comparison - Stack Overflow
Browsing index pages (3 articles)

.NET 5.0 breaking changes regarding `IEnumerable.OrderBy` behavior on string...

I have below code public class Model { public int Id { get; set; } public string OrderNumber { get; set; } } class Program { static void Main(string[] args) { var models = new List<Model> { new...

View Article


Answer by Logarr for .NET 5.0 breaking changes regarding...

I'm guessing it has something to do with the change to use International Components for Unicode (ICU) libraries as the default.You can read about it specifically as it affects string comparison here:...

View Article


Answer by tmaj for .NET 5.0 breaking changes regarding `IEnumerable.OrderBy`...

What @Loggar said and for your specific case to get consistent behaviour the change will be to pass the string comparer to OrderBy:.OrderBy(x => x, StringComparer.InvariantCultureIgnoreCase)

View Article
Browsing index pages (3 articles)


Latest Images