IMetadataGetExtensions Class
Namespace
Statiq.Common
Base Types
  • object
graph BT Type-->Base0["object"] Type["IMetadataGetExtensions"] class Type type-node

Syntax

public static class IMetadataGetExtensions

Methods

Name Return Value Summary
FilterMetadata(IMetadata, string[]) IMetadata
Gets a new filtered IMetadata containing only the specified keys and their values. If a key is not present in the current metadata, it will be ignored and will not be copied to the new metadata object.
static
Get(IMetadata, string, object) object
Gets the value for the specified key. This method never throws an exception. It will return the specified default value or null if the key is not found or is null.
static
Get<T>(IMetadata, string, T) T
Gets the value for the specified key. This method never throws an exception. It will return the specified default value if the key is not found or is null.
static
Get<T>(IMetadata, string) T
Gets the value for the specified key converted to the specified type. This method never throws an exception. It will return default(T) if the key is not found, is null, or the value cannot be converted to T.
static
GetEnumerable(IMetadata) IEnumerable<KeyValuePair<string, object>>
Gets an enumerable that enumerates key-value pairs.
static
GetRaw(IMetadata, string) object
Gets the raw value for the specified key. This method will not materialize IMetadataValue values the way other get methods will. A System.Collections.Generic.KeyNotFoundException will be thrown for missing keys.
static
GetRawEnumerable(IMetadata) IEnumerable<KeyValuePair<string, object>>
Gets an enumerable that enumerates raw key-value pairs (I.e., the values have not been expanded similar to TryGetRaw(string, object)).
static
TryGetValue<TValue>(IMetadata, string, TValue) bool
Tries to get the value for the specified key.
static
WithoutSettings(IMetadata) IMetadata
static