RequireKeys<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>, TKey[]) Method
Verifies that a dictionary contains all requires keys. An System.ArgumentException will be thrown if the specified keys are not all present in the dictionary.
Namespace
Statiq.Common
Containing Type
IReadOnlyDictionaryExtensions

Syntax

public static void RequireKeys<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, params TKey[] keys)

Type Parameters

Name Description
TKey The type of keys.
TValue The type of values.

Parameters

Name Type Description
dictionary IReadOnlyDictionary<TKey, TValue> The dictionary to verify.
keys TKey[] The keys that must be present in the dictionary.