public static IQueryable <EntryReport> OrderBy(this IQueryable <EntryReport> query, EntryReportSortRule sortRule) => sortRule switch
 {
示例#2
0
        public static IQueryable <EntryReport> OrderBy(this IQueryable <EntryReport> query, EntryReportSortRule sortRule)
        {
            switch (sortRule)
            {
            case EntryReportSortRule.CloseDate:
                return(query.OrderByDescending(e => e.ClosedAt ?? e.Created));

            case EntryReportSortRule.Created:
                return(query.OrderByDescending(e => e.Created));
            }

            return(query);
        }