I get weird behavior with a OrderBy()method Lists.
OrderBy()
Lists
Imagine that you have a List, and each person has Firstname, Lastnameand Gender. If all the people on this list have Gender "m", after each call
Firstname
Lastname
Gender
"m"
list.OrderBy(p => p.Gender)
But I do not want my list to hop on every update. Any idea on this?
You can use ThenBy()to sort using other properties, if Paul is the same. Like this:
ThenBy()
list.OrderBy(p=>p.Gender).ThenBy(p=>p.FirstName);
Gender m , m , . , , m. , - , , FirstName.
m
FirstName
list.OrderBy(p=>p.Firstname);
list.OrderBy(p=>p.Lastname);
Sort by all fields, for example:
list.OrderBy(x=>x.Gender).ThenBy(x=>x.FirstName).ThenBy(x=>x.LastName);
Source: https://habr.com/ru/post/1652986/More articles:Jenkins - The process gets stuck when starting the page for installing plugins - jenkinsAdding a gap to the product name on store pages for a specific length - phpFirefox WebExtention not loading - firefox-addonWhy is the global variable not set immediately after defining the callback / listen function (asynchronous messaging, port.on) - javascriptUpload file to FTP server from line or stream - c #Wagon car - how to find out mysql username / password - mysqlWhy do my Jasmine specs say "No specs found" - javascriptCalculations with various data types in CRM - c #Responsive transfer parameter with arrow in child component - ecmascript-6https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1652991/pass-variables-to-another-script&usg=ALkJrhiJnkWRVOO4D93AS96vYbQLxpbP2AAll Articles