Table of Contents

Class NameValueCollectionExtensions

Namespace
Cuemon.Extensions.Collections.Specialized
Assembly
Cuemon.Extensions.Collections.Specialized.dll

Extension methods for the System.Collections.Specialized.NameValueCollection class.

public static class NameValueCollectionExtensions
Inheritance
Object
NameValueCollectionExtensions

Methods

ContainsKey(NameValueCollection, String)

Determines whether the specified nvc contains an entry with the specified key.

public static bool ContainsKey(this NameValueCollection nvc, string key)

Parameters

nvc NameValueCollection

The System.Collections.Specialized.NameValueCollection to extend.

key String

The key to locate in nvc.

Returns

Boolean

true if the specified nvc contains an entry with the key; otherwise, false.

Remarks

This method performs an System.StringComparison.OrdinalIgnoreCase search for key.

ToDictionary(NameValueCollection, Action<DelimitedStringOptions>)

Creates a System.Collections.Generic.IDictionary<TKey, TValue> from the specified nvc.

public static IDictionary<string, string[]> ToDictionary(this NameValueCollection nvc, Action<DelimitedStringOptions> setup = null)

Parameters

nvc NameValueCollection

The System.Collections.Specialized.NameValueCollection to extend.

setup Action<DelimitedStringOptions>

The DelimitedStringOptions which may be configured.

Returns

IDictionary<String, String[]>

A System.Collections.Generic.IDictionary<TKey, TValue> that is equivalent to the specified nvc.

Exceptions

System.ArgumentNullException

nvc cannot be null.