/// <summary> /// Modifies the current sort stage by appending a descending field specification to it. /// </summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="aggregate">The aggregate.</param> /// <param name="field">The field to sort by.</param> /// <returns> /// The fluent aggregate interface. /// </returns> public static IOrderedAggregateFluent <TResult> ThenByDescending <TResult>(this IOrderedAggregateFluent <TResult> aggregate, Expression <Func <TResult, object> > field) { Ensure.IsNotNull(aggregate, nameof(aggregate)); return(aggregate.ThenBy(Builders <TResult> .Sort.Descending(field))); }
Order <T>(IOrderedAggregateFluent <T> source) { return(source.ThenBy(Property.QueryFrom <T>())); }