Class NameValueCollectionExtensions
Miscellaneous functions and extensions for all elements of the NameValueCollection type.
Inherited Members
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class NameValueCollectionExtensions
Methods
| Edit this page View SourceToDictionary(NameValueCollection)
Converts a NameValueCollection into a collection of Dictionary<TKey, TValue>.
Declaration
public static Dictionary<string, string[]> ToDictionary(this NameValueCollection nvc)
Parameters
Type | Name | Description |
---|---|---|
NameValueCollection | nvc | NameValueCollection to convert. |
Returns
Type | Description |
---|---|
Dictionary<string, string[]> | A collection of Dictionary<TKey, TValue> with the keys and their respective values. |
Remarks
This method will omit all values whose name is null.
ToGroup(NameValueCollection)
Converts a NameValueCollection into a collection of IGrouping<TKey, TElement>.
Declaration
public static IEnumerable<IGrouping<string?, string>> ToGroup(this NameValueCollection nvc)
Parameters
Type | Name | Description |
---|---|---|
NameValueCollection | nvc | NameValueCollection to convert. |
Returns
Type | Description |
---|---|
IEnumerable<IGrouping<string, string>> | A collection of IGrouping<TKey, TElement> with the keys and their respective values. |
ToKeyValuePair(NameValueCollection)
Converts a NameValueCollection into a collection of KeyValuePair<TKey, TValue>.
Declaration
public static IEnumerable<KeyValuePair<string?, string>> ToKeyValuePair(this NameValueCollection nvc)
Parameters
Type | Name | Description |
---|---|---|
NameValueCollection | nvc | NameValueCollection to convert. |
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> | A collection of KeyValuePair<TKey, TValue> with the keys and their respective values. |
ToNamedObjectCollection(NameValueCollection)
Converts a NameValueCollection into a collection of NamedObject<T>.
Declaration
public static IEnumerable<NamedObject<string[]>> ToNamedObjectCollection(this NameValueCollection nvc)
Parameters
Type | Name | Description |
---|---|---|
NameValueCollection | nvc | NameValueCollection to convert. |
Returns
Type | Description |
---|---|
IEnumerable<NamedObject<string[]>> | A collection of NamedObject<T> with the keys and their respective values. |
Remarks
This method will omit all values whose name is null.