OrderBy Class


Orders the input documents based on the specified key function.
Base Types
  • Object
graph TD Base0["Object"]-->Type Interface0["IModule"]-.->Type click Interface0 "/api/Wyam.Common.Modules/IModule" Type["OrderBy"] class Type type-node


public class OrderBy : IModule


The ordered documents are output as the result of this module.


Name Summary
OrderBy(DocumentConfig) Orders the input documents using the specified delegate to get the ordering key.


Name Value Summary
Descending(bool) OrderBy
Specifies whether the documents should be output in descending order (the default is ascending order). If you use this method after called ThenBy, the descending ordering will apply to the secondary sort.
Execute(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<IDocument>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
ThenBy(DocumentConfig) OrderBy
Orders the input documents using the specified delegate to get a secondary ordering key. You can chain as many ThenBy calls together as needed.
WithComparer(IComparer<Object>) OrderBy
Specifies a comparer to use for the ordering.
WithComparer<TValue>(IComparer<TValue>) OrderBy
Specifies a typed comparer to use for the ordering. A conversion to the comparer type will be attempted for all metadata values. If the conversion fails, the values will be considered equivalent. Note that this will also have the effect of treating different convertible types as being of the same type. For example, if you have two keys, 1 and "1", and use a string-based comparison, the documents will compare as equal.