MetadataItem Structure
Provides slightly nicer syntax than KeyValuePair<string, object> for working with metadata. Also contains a constructor that makes adding delegate-based metadata easier.
Namespace
Statiq.Common
Base Types
  • object
  • ValueType
graph BT Type-->Base0["ValueType"] Base0-->Base1["object"] 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 Property Type 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

Extension Methods