I have an event listing API, which takes as input start and end dates and returns a list of events. The requirement for sort, is to show closest to farthest events by start date in the past, followed by closest to farthest event by end date in the future.
Essentially the following logic (which was done on a list previously).
List<EventModel> newList = listEvent.Where(e => e.startDT <= DateTime.Today).OrderByDescending(e => e.startDT).ToList(); newList.AddRange(listEvent.Where(e => e.startDT > DateTime.Today).OrderBy(e => e.endDT)); listEvent = newList;
How can I achieve this on an IQueryable to execute in my SOLR search?
I see that concat isn't supported with Linq to Sitecore https://doc.sitecore.com/developers/90/sitecore-experience-management/en/linq-to-sitecore.html
Any other way to do this?