Orders the input documents based on the specified key function.
- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
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 |
Orders the input documents using the specified delegate to get the ordering value. |
OrderDocuments |
Orders the input documents using the value of the specified metadata key. |
Methods
Name | Return Value | Summary |
---|---|---|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
Descending |
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 |
Task |
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 |
Task |
Executes the module once for all input documents.
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from Module
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
ThenBy |
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 |
OrderDocuments |
Orders the input documents using the value of the specified metadata key.
You can chain as many
ThenBy calls together as needed.
|
WithComparer |
OrderDocuments |
Specifies a comparer to use for the ordering.
|
WithComparer |
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 |
OrderDocuments |
Specifies a comparison delegate to use for the ordering.
|
WithComparison |
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.
|