07-24-2023, 09:02 AM
I have a class called `Order` which has properties such as `OrderId`, `OrderDate`, `Quantity`, and `Total`. I have a list of this `Order` class:
```c#
List<Order> objListOrder = new List<Order>();
GetOrderList(objListOrder); // fill list of orders
```
I want to sort the list based on one property of the `Order` object; for example, either by `OrderDate` or `OrderID`.
How can I do this in C#?
```c#
List<Order> objListOrder = new List<Order>();
GetOrderList(objListOrder); // fill list of orders
```
I want to sort the list based on one property of the `Order` object; for example, either by `OrderDate` or `OrderID`.
How can I do this in C#?