Evaluates a series of child modules for each input document if a specified condition is met.
- Namespace
- Statiq
.Core - Interfaces
-
- IModule
- IList
<IfCondition> - ICollection
<IfCondition> - IEnumerable
<IfCondition> - IEnumerable
- 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-.->Interface1["IList<IfCondition>"]
Type-.->Interface2["ICollection<IfCondition>"]
Type-.->Interface3["IEnumerable<IfCondition>"]
Type-.->Interface4["IEnumerable"]
Type["ExecuteIf"]
class Type type-node
Syntax
public class ExecuteIf : Module, IModule, IList<IfCondition>, ICollection<IfCondition>,
IEnumerable<IfCondition>, IEnumerable
Remarks
Any result documents from the child modules will be returned as the result of the
this module. Any input documents that don't match a predicate will be returned as
outputs without modification.
Constructors
Name | Summary |
---|---|
ExecuteIf |
Specifies a predicate and a series of child modules to be evaluated if the predicate returns true .
|
ExecuteIf |
Specifies a predicate and a series of child modules to be evaluated if the predicate returns true .
|
ExecuteIf |
Specifies child modules to be evaluated if a given metadata key is present in the input document. |
ExecuteIf |
Specifies child modules to be evaluated if a given metadata key is present in the input document. |
ExecuteIf |
Specifies child modules to be evaluated if a given metadata key is present in the input document. |
ExecuteIf |
Specifies child modules to be evaluated if a given metadata key is present in the input document. |
Properties
Name | Property Type | Summary |
---|---|---|
Count | int | |
IsReadOnly | bool | |
this[int] | IfCondition |
Methods
Name | Return Value | Summary |
---|---|---|
Add |
void | |
Add |
void |
Adds a module to the initial condition. This method is mainly to support collection initialization of the module.
|
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
|
Clear |
void | |
Contains |
bool | |
CopyTo |
void | |
Else |
IModule |
This should be at the end of your fluent method chain and will evaluate the
specified child modules on all documents that did not satisfy previous predicates.
The predicate will be evaluated against every input document individually.
|
Else |
IModule |
This should be at the end of your fluent method chain and will evaluate the
specified child modules on all documents that did not satisfy previous predicates.
The predicate will be evaluated against every input document individually.
|
ElseIf |
ExecuteIf |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
|
ElseIf |
ExecuteIf |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
|
ElseIf |
ExecuteIf |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
|
ElseIf |
ExecuteIf |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
|
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
|
GetEnumerator |
IEnumerator |
|
IndexOf |
int | |
Insert |
void | |
Remove |
bool | |
RemoveAt |
void | |
Without |
ExecuteIf |
The default behavior of this module is to "fall through" any documents that
didn't match one of the conditions and add it to the result set. This method
allows you to change that behavior and prevent unmatched documents from being
added to the result set.
|