OrderDocuments Class
Orders the input documents based on the specified key function.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["Module"] click Base0 "/api/Statiq.Common/Module" Base0-->Base1["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type["OrderDocuments"] class Type type-node

Syntax

public class OrderDocuments : Module, IModule

Remarks

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

Constructors

Name Summary
OrderDocuments() Orders the input documents using the Index value first, then the Order value, and then by the document file name.
OrderDocuments(Config<object>) Orders the input documents using the specified delegate to get the ordering value.
OrderDocuments(string) Orders the input documents using the value of the specified metadata key.

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
Descending(bool) OrderDocuments
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.
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from Module
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
ThenBy(Config<object>) OrderDocuments
Orders the input documents using the specified delegate to get a secondary ordering value. You can chain as many ThenBy calls together as needed.
ThenBy(string) OrderDocuments
Orders the input documents using the value of the specified metadata key. You can chain as many ThenBy calls together as needed.
WithComparer(IComparer<object>) OrderDocuments
Specifies a comparer to use for the ordering.
WithComparer<TValue>(IComparer<TValue>) OrderDocuments
Specifies a typed comparer to use for the ordering. A conversion to the comparer type will be attempted for the object being compared. If the conversion fails for either object, the default object comparer will be used. 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.
WithComparison(Comparison<object>) OrderDocuments
Specifies a comparison delegate to use for the ordering.
WithComparison<TValue>(Comparison<TValue>) OrderDocuments
Specifies a typed comparison delegate to use for the ordering. A conversion to the comparison type will be attempted for the object being compared. If the conversion fails for either object, the default object comparer will be used. 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