Show / Hide Table of Contents

Class NameValueCollectionExtensions

Miscellaneous functions and extensions for all elements of the NameValueCollection type.

Inheritance
object
NameValueCollectionExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class NameValueCollectionExtensions

Methods

| Edit this page View Source

ToDictionary(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX