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
FormDataCollectionThe form data.
type
TypeThe 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
FormDataCollectionThe form data.
type
TypeThe type of the object.
modelName
stringThe name of the model.
requiredMemberSelector
IRequiredMemberSelectorThe required member selector.
formatterLogger
IFormatterLoggerThe 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
FormDataCollectioncollection with parsed form url data
type
Typetarget type to read as
modelName
stringnull 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
IRequiredMemberSelectorThe System.Net.Http.Formatting.IRequiredMemberSelector used to determine required members.
formatterLogger
IFormatterLoggerThe System.Net.Http.Formatting.IFormatterLogger to log events to.
config
HttpConfigurationThe 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
FormDataCollectiontype
TypemodelName
stringactionContext
HttpActionContext
Returns
ReadAs(FormDataCollection, Type, HttpActionContext)
public static object ReadAs(this FormDataCollection formData, Type type, HttpActionContext actionContext)
Parameters
formData
FormDataCollectiontype
TypeactionContext
HttpActionContext
Returns
ReadAs<T>(FormDataCollection)
Reads the collection extensions with specified type.
public static T ReadAs<T>(this FormDataCollection formData)
Parameters
formData
FormDataCollectionThe 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
FormDataCollectionThe form data.
modelName
stringThe name of the model.
requiredMemberSelector
IRequiredMemberSelectorThe required member selector.
formatterLogger
IFormatterLoggerThe 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
FormDataCollectionmodelName
stringactionContext
HttpActionContext
Returns
- T
Type Parameters
T
ReadAs<T>(FormDataCollection, HttpActionContext)
public static T ReadAs<T>(this FormDataCollection formData, HttpActionContext actionContext)
Parameters
formData
FormDataCollectionactionContext
HttpActionContext
Returns
- T
Type Parameters
T