0

Let's say I have a class called Order, for each order of burgers I do at a burger restaurant. I have an array of all the orders that have been placed today (Order[]) called orderstoday I want to sort orderstoday[] by the time each order have been placed, which can be obtained by Order.timestamp. How do I do this? Thanks.

5
  • Please show the classes and the structure Commented May 30, 2017 at 6:34
  • What you have tried so far ? Commented May 30, 2017 at 6:35
  • Note that the question mentions alphabetical sort; however, the answers there will also solve your problem of sorting by date. Commented May 30, 2017 at 6:35
  • using System.Linq; orders.OrderBy(order=>order.TimeStamp) You can check this page tutorialsteacher.com/linq/… Commented May 30, 2017 at 6:37
  • thanks miguel that helped me Commented May 30, 2017 at 9:39

0