Class NameValueCollectionExtensions
- Assembly
- Cuemon.Extensions.Collections.Specialized.dll
Extension methods for the NameValueCollection class.
public static class NameValueCollectionExtensions
- Inheritance
-
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
NameValueCollectionThe NameValueCollection to extend.
key
StringThe key to locate in
nvc
.
Returns
- Boolean
true
if the specifiednvc
contains an entry with thekey
; otherwise,false
.
Remarks
This method performs an OrdinalIgnoreCase search for key
.
ToDictionary(NameValueCollection, Action<DelimitedStringOptions>)
Creates a IDictionary<TKey,TValue> from the specified nvc
.
public static IDictionary<string, string[]> ToDictionary(this NameValueCollection nvc, Action<DelimitedStringOptions> setup = null)
Parameters
nvc
NameValueCollectionThe NameValueCollection to extend.
setup
Action<DelimitedStringOptions>The DelimitedStringOptions which may be configured.
Returns
- IDictionary<String, String[]>
A IDictionary<TKey,TValue> that is equivalent to the specified
nvc
.
Exceptions
- ArgumentNullException
nvc
cannot be null.