FormDataCollection Class

Definition

Represent the form data.

  • This has 100% fidelity (including ordering, which is important for deserializing ordered array).
  • using interfaces allows us to optimize the implementation. E.g., we can avoid eagerly string-splitting a 10gb file.
  • This also provides a convenient place to put extension methods.
public class FormDataCollection : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,string>>
type FormDataCollection = class
    interface seq<KeyValuePair<string, string>>
    interface IEnumerable
Public Class FormDataCollection
Implements IEnumerable(Of KeyValuePair(Of String, String))
Inheritance
FormDataCollection
Implements

Constructors

FormDataCollection(IEnumerable<KeyValuePair<String,String>>)

Initialize a form collection around incoming data. The key value enumeration should be immutable.

FormDataCollection(String)

Initialize a form collection from a URL encoded query string. Any leading question mark (?) will be considered part of the query string and treated as any other value.

FormDataCollection(Uri)

Initialize a form collection from a query string. Uri and FormURl body have the same schema.

Properties

Item[String]

Gets values associated with a given key. If there are multiple values, they're concatenated.

Methods

Get(String)

Get values associated with a given key. If there are multiple values, they're concatenated.

GetEnumerator()
GetValues(String)

Get a value associated with a given key.

ReadAsNameValueCollection()

Get the collection as a NameValueCollection. Beware this loses some ordering. Values are ordered within a key, but keys are no longer ordered against each other.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Extension Methods

GetJQueryNameValuePairs(FormDataCollection)

Applies to