0

Currently I have the following LINQ extension to order my list by ascending order

var reportsAscending = report.OrderBy(x => x.ApprovalAuditDate).ToList();

But the problem I am having is that the list named reportsAscending has empty Approval Audit Dates at the start of the list rather than dates.

enter image description here

Is there a way to get the empty/null dates towards the end of the list?

The property is public DateTime? ApprovalAuditDate { get; set; }

For data type string I am using report.OrderBy(x => string.IsNullOrWhiteSpace(x.ApprovalStatus)).ThenBy(x => x.ApprovalStatus).ToList(); which works perfectly

WKara
  • 109
  • 9

0 Answers0