Class NameValueCollectionExtensions
- Assembly
- Cuemon.Extensions.Collections.Specialized.dll
Extension methods for the System.Collections.Specialized.NameValueCollection class.
public static class NameValueCollectionExtensions
- Inheritance
-
ObjectNameValueCollectionExtensions
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 System.Collections.Specialized.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 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
NameValueCollectionThe 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.