CollectionExtensions.

RequireKeys<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>, TKey[]) Method

Summary

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.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Util
Containing Type
CollectionExtensions

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.

Return Value

Type Description
void
GitHub