ReadDataModule<TModule, TItem>.

GetDictionary(TItem) Method

Summary

Used to convert each object from Wyam.Common.Modules.ReadDataModule`2.GetItems(System.Collections.Generic.IReadOnlyList{Wyam.Common.Documents.IDocument},Wyam.Common.Execution.IExecutionContext) into a IDictionary<string, object>. The base implementation checks if the object implements IDictionary<string, object> and just performs a cast is if it does. If not, reflection is used to construct a IDictionary<string, object> from all of the object's properties. Override this method to provide an alternate way of getting key-value pairs for each object.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Modules
Containing Type
ReadDataModule<TModule, TItem>

Syntax

protected virtual IDictionary<string, Object> GetDictionary(TItem item)

Parameters

Name Type Description
item TItem The object to convert to a IDictionary<string, object>.

Return Value

Type Description
IDictionary<string, Object> A IDictionary<string, object> containing the data used for document creation.
GitHub