EnumerateValues Class
Clones a new document for each item in a given metadata value.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["ParallelConfigModule<IEnumerable<object>>"] Base0-->Base1["Module"] click Base1 "/api/Statiq.Common/Module" Base1-->Base2["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type-.->Interface1["IParallelModule"] click Interface1 "/api/Statiq.Common/IParallelModule" Type["EnumerateValues"] class Type type-node

Syntax

public class EnumerateValues : ParallelConfigModule<IEnumerable<object>>, IModule, IParallelModule

Remarks

Enumerates values returned by a config and clones a document for each one. The current value for each cloned document is contained in Current. Generally speaking you shouldn't enumerate documents since they get cloned as a pipeline progresses. Instead you should enumerate some identifier and operate on that to find the correct documents when the template gets rendered.

Constructors

Name Summary
EnumerateValues() Enumerates the values stored in the Enumerate metadata key.
EnumerateValues(Config<IEnumerable<object>>) Enumerates the values returned by the config and clones a document for each one. If the config returns null for a given document, the original input document will be output. If the config returns an empty enumerable for a given document, no result documents will be output for that input document.
EnumerateValues(Config<string>) Enumerates the values stored in the given 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
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
ExecuteConfigAsync(IDocument, IExecutionContext, IEnumerable<object>) Task<IEnumerable<IDocument>>
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
WithCurrentKey(string) EnumerateValues
Sets the metadata key to use for storing the current enumerated value in cloned documents. This is Current by default.
WithInputDocument(Config<bool>) EnumerateValues
If the configuration delegate returns true the original input document will be included as the first result. By default, EnumerateWithInput is used.

Extension Methods