Executes sequences of modules depending on whether the input document contains a specified value.
- 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["ExecuteSwitch"]
class Type type-node
Syntax
public class ExecuteSwitch : Module, IModule
Remarks
When creating a Switch module you specify a delegate that will get an object for each document. Cases are then
defined via fluent methods that compare the returned object for each document against a supplied object (or array).
If the defined object or any of the objects in the array for the case equal the one for the document, the modules
in the case are executed. The output of the module is the aggregate output of executing the specified modules against
documents matching each case. If a document does not match a defined case, it is executed against the default case (if defined)
or output without modification (if no default is defined).
Constructors
Name | Summary |
---|---|
ExecuteSwitch |
Defines the delegate that will be invoked against each input document to get the case comparison value. |
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
|
Case |
ExecuteSwitch |
Defines a case.
|
Case |
ExecuteSwitch |
Defines a case.
|
Default |
ExecuteSwitch |
Defines modules to execute against documents that don't match a case.
|
Default |
ExecuteSwitch |
Defines modules to execute against documents that don't match a case.
|
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
|