I've created a news-section in my website. Nothing new and working fine. Except now I wanna sort the news items by date. One problem is that the sorting dates are spread over multiple columns. I've created a newsdate field which isn't mandatory. When the newsdate column is empty the created date is used.
how do I sort my newsItems using both of these column
Example
newsitem1: newsdate = 3 aug 2012, createDate = 7 aug 2012
newsitem2: newsdate = emtpy, create date = 7 aug 2012
newsitem3: newsdate = 25 jul 2012, createDate 7 aug
Result (sorting order):
newsitem2, newsitem1, newsitem3
because all is created in Umbraco using a razorview-marco I see no option to manipulate the object so the sorting has to be done in a linq-query.
var nodes = @Model.AncestorOrSelf("Home").Children.Where("Visible").OrderBy(???)