ConfigHelper<T> Class

Summary

This class satisfies a common use case for modules where you need to get some configuration value either directly, from a delegate at the module level, or from a delegate at a per-document level and the user should be able to specify any of these possibilities (typically via module constructor overloads).
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Configuration
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["ConfigHelper<T>"] class Type type-node

Syntax

public class ConfigHelper<T>

Type Parameters

Name Description
T The type of the value you want to eventually convert to.

Constructors

Name Summary
ConfigHelper(ContextConfig, T) Creates a new helper with the specified delegate.
ConfigHelper(DocumentConfig, T) Creates a new helper with the specified delegate.
ConfigHelper(T) Creates a new helper with the specified value.

Methods

Name Value Summary
GetValue(IDocument, IExecutionContext, Func<T, T>) T
Call this each time you need the value, passing in a post-processing function if required. If no document delegate is specified, then this will get and cache the value on first request.
GitHub