OrderBy Class

Summary

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

Syntax

public class OrderBy : IModule

Remarks

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

Constructors

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

Methods

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<T>
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.

Extension Methods

Name Value Summary
WithName(string) IModule
GitHub