MetadataItem Struct

Summary

Provides slightly nicer syntax than KeyValuePair<string, object> for working with metadata. Also contains a constructor that makes adding delegate-based metadata easier.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Meta
Base Types
  • ValueType
graph BT Type-->Base0["ValueType"] Type["MetadataItem"] class Type type-node

Syntax

public struct MetadataItem : ValueType

Constructors

Name Summary
MetadataItem(KeyValuePair<string, Object>) Creates a new metadata item with a specified key-value pair.
MetadataItem(string, Func<IMetadata, Object>, bool) This creates a new metadata value based on the specified delegate that will get evaluated on every value request. Note that the delegate function should be thread-safe.
MetadataItem(string, Object) Creates a new metadata item with the specified key and value.

Properties

Name Value Summary
Key string
Gets the key of the item.
Pair KeyValuePair<string, Object>
Gets the underlying KeyValuePair<TKey, TValue>.
Value Object
Gets the value of the item.

Operators

Name Value Summary
implicit operator KeyValuePair<string, Object>(MetadataItem) KeyValuePair<string, Object>
implicit operator MetadataItem(KeyValuePair<string, Object>) MetadataItem
GitHub