Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# how to sort a list

var simpleList = new List<ObjectName>();
// Order by a property
list.OrderBy(o => o.PropertyName);
// Order by multiple property
list.OrderBy(o => o.PropertyName).ThenBy(o => o.AnotherProperty);
// Same but descending
list.OrderByDescending(o => o.PropertyName).ThenByDescending(o => o.AnotherProperty);
Comment

sorting a list of objects in c#

List<Order> SortedList = objListOrder.OrderBy(o=>o.OrderDate).ToList();
List<Order> DescSortedList = objListOrder.OrderByDescending(o=>o.OrderDate).ToList();
Comment

PREVIOUS NEXT
Code Example
Csharp :: valid URL check in c# 
Csharp :: Convert DataTable to Dictionary in C# 
Csharp :: instantiate a player in photon 
Csharp :: unity custom editor 
Csharp :: length of a string c# 
Csharp :: c# remove first three characters from string 
Csharp :: unity no serializefield 
Csharp :: unity find gameobject with layer 
Csharp :: checking if character is a digit or not in c# 
Csharp :: google script get time 
Csharp :: get color of pixel c# 
Csharp :: generate random dark colors programatically in android 
Csharp :: c# bubble sort 
Csharp :: multiplication using arrays 
Csharp :: use raycast unity new input system 
Csharp :: hwo to prevent rotation after hitting an object in unity 
Csharp :: c# excel workbook 
Csharp :: c# right function 
Csharp :: is number c# 
Csharp :: power of number 
Csharp :: unity toint 
Csharp :: if set active == false unity 
Csharp :: C# bitwise operation 
Csharp :: string tochararray c# 
Csharp :: wpf clear grid 
Csharp :: scale between tow ranges c# 
Csharp :: how to remove all comma from string c# 
Csharp :: c# xml comment type reference 
Csharp :: vb.net get date minus one day 
Csharp :: Convert Json String to model Class or Object 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =