Table of Contents

Class FormDataCollectionExtensions

Namespace
System.Web.Http.ModelBinding
Assembly
System.Web.Http.dll

Represents the extensions for the collection of form data.

public static class FormDataCollectionExtensions
Inheritance
FormDataCollectionExtensions
Inherited Members

Methods

ReadAs(FormDataCollection, Type)

Reads the collection extensions with specified type.

public static object ReadAs(this FormDataCollection formData, Type type)

Parameters

formData FormDataCollection

The form data.

type Type

The type of the object.

Returns

object

The collection extensions with specified type.

ReadAs(FormDataCollection, Type, string, IRequiredMemberSelector, IFormatterLogger)

Reads the collection extensions with specified type and model name.

public static object ReadAs(this FormDataCollection formData, Type type, string modelName, IRequiredMemberSelector requiredMemberSelector, IFormatterLogger formatterLogger)

Parameters

formData FormDataCollection

The form data.

type Type

The type of the object.

modelName string

The name of the model.

requiredMemberSelector IRequiredMemberSelector

The required member selector.

formatterLogger IFormatterLogger

The formatter logger.

Returns

object

The collection extensions.

ReadAs(FormDataCollection, Type, string, IRequiredMemberSelector, IFormatterLogger, HttpConfiguration)

Deserialize the form data to the given type, using model binding.

public static object ReadAs(this FormDataCollection formData, Type type, string modelName, IRequiredMemberSelector requiredMemberSelector, IFormatterLogger formatterLogger, HttpConfiguration config)

Parameters

formData FormDataCollection

collection with parsed form url data

type Type

target type to read as

modelName string

null or empty to read the entire form as a single object. This is common for body data. Or the name of a model to do a partial binding against the form data. This is common for extracting individual fields.

requiredMemberSelector IRequiredMemberSelector

The System.Net.Http.Formatting.IRequiredMemberSelector used to determine required members.

formatterLogger IFormatterLogger

The System.Net.Http.Formatting.IFormatterLogger to log events to.

config HttpConfiguration

The HttpConfiguration configuration to pick binder from. Can be null if the config was not created already. In that case a new config is created.

Returns

object

best attempt to bind the object. The best attempt may be null.

ReadAs(FormDataCollection, Type, string, HttpActionContext)

public static object ReadAs(this FormDataCollection formData, Type type, string modelName, HttpActionContext actionContext)

Parameters

formData FormDataCollection
type Type
modelName string
actionContext HttpActionContext

Returns

object

ReadAs(FormDataCollection, Type, HttpActionContext)

public static object ReadAs(this FormDataCollection formData, Type type, HttpActionContext actionContext)

Parameters

formData FormDataCollection
type Type
actionContext HttpActionContext

Returns

object

ReadAs<T>(FormDataCollection)

Reads the collection extensions with specified type.

public static T ReadAs<T>(this FormDataCollection formData)

Parameters

formData FormDataCollection

The form data.

Returns

T

The read collection extensions.

Type Parameters

T

The generic type.

ReadAs<T>(FormDataCollection, string, IRequiredMemberSelector, IFormatterLogger)

Reads the collection extensions with specified type.

public static T ReadAs<T>(this FormDataCollection formData, string modelName, IRequiredMemberSelector requiredMemberSelector, IFormatterLogger formatterLogger)

Parameters

formData FormDataCollection

The form data.

modelName string

The name of the model.

requiredMemberSelector IRequiredMemberSelector

The required member selector.

formatterLogger IFormatterLogger

The formatter logger.

Returns

T

The collection extensions.

Type Parameters

T

The generic type.

ReadAs<T>(FormDataCollection, string, HttpActionContext)

public static T ReadAs<T>(this FormDataCollection formData, string modelName, HttpActionContext actionContext)

Parameters

formData FormDataCollection
modelName string
actionContext HttpActionContext

Returns

T

Type Parameters

T

ReadAs<T>(FormDataCollection, HttpActionContext)

public static T ReadAs<T>(this FormDataCollection formData, HttpActionContext actionContext)

Parameters

formData FormDataCollection
actionContext HttpActionContext

Returns

T

Type Parameters

T