I have a nodes of alias seminars with a property of seminarDate. I'm attempting to order these nodes under the parent node of type Schedule and then display only the next seminar coming up (ignoring any dates which has past). See attempt below.
var latestSeminar = @Model.Content.AncestorOrSelf(1).DescendantOrSelf("Schedule").Children.OrderBy("seminarDate").First(x => x.seminarDate > DateTime.Now).GetPropertyValue("seminarDate");
Hi Amir, it won't always be the first as the list contains all seminar which have happen. I'm sure there is a way to create a dynamic list and then filter by property just don't no how yet!?
OrderBy() followed by First()
I have a nodes of alias seminars with a property of seminarDate. I'm attempting to order these nodes under the parent node of type Schedule and then display only the next seminar coming up (ignoring any dates which has past). See attempt below.
If the upcoming one is always the first one, you could just use Take(1).
-Amir
Hi Amir, it won't always be the first as the list contains all seminar which have happen. I'm sure there is a way to create a dynamic list and then filter by property just don't no how yet!?
Hi John,
You are very close already!
Thank You
is working on a reply...