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.
-
Please show the classes and the structureArion– Arion2017-05-30 06:34:34 +00:00Commented May 30, 2017 at 6:34
-
What you have tried so far ?Eldho– Eldho2017-05-30 06:35:02 +00:00Commented 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.Rob– Rob ♦2017-05-30 06:35:31 +00:00Commented May 30, 2017 at 6:35
-
using System.Linq; orders.OrderBy(order=>order.TimeStamp) You can check this page tutorialsteacher.com/linq/…Miguel– Miguel2017-05-30 06:37:56 +00:00Commented May 30, 2017 at 6:37
-
thanks miguel that helped meuser7657800– user76578002017-05-30 09:39:01 +00:00Commented May 30, 2017 at 9:39
Add a comment
|