Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

built in methods to order a list c#

using System.Linq;
//This list contains OrderDate, OrderID, Quantity, Total properties
List<Order> objListOrder = new List<Order>(); 
//How to GetOrderList(objListOrder)?
//Answer:
//- Ascending order
List<Order> SortedList = objListOrder.OrderBy(o=>o.OrderDate).ToList();
//- Descending order
List<Order> SortedList = objListOrder.OrderByDescending(o=>o.OrderDate).ToList();
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to write a variable in console c# 
Csharp :: remove last comma from string c# 
Csharp :: c# get month number from name 
Csharp :: dictionary to string c# 
Csharp :: increase variable C# 
Csharp :: c# shuffle array 
Csharp :: c# mongodb connection 
Csharp :: how to generate random numbers in c# 
Csharp :: despicable me 
Csharp :: how to encode and decode a string in c# 
Csharp :: validate data exist in database lara vel 
Csharp :: c# read text file separated by comma 
Csharp :: T SQL Format GetDate() 
Csharp :: getname of month from date c# 
Csharp :: content type application/json c# 
Csharp :: SAVE FLOAT UNITY 
Csharp :: how to start cmd in c# 
Csharp :: how to print a matrix in c# 
Csharp :: hello world c# 
Csharp :: unity deltatime 
Csharp :: httppostedfilebase in .net core 3.1 
Csharp :: Find an item in a list by LINQ 
Csharp :: unity set dropdown value 
Csharp :: unity keycode for f 
Csharp :: how to create a file through c# script 
Csharp :: find-text-in-string-with-c-sharp 
Csharp :: c# timestamp now 
Csharp :: c# print exception stack trace 
Csharp :: c# list string return concatenate 
Csharp :: unity c# foreach 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =