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
formDataFormDataCollectionThe form data.
typeTypeThe 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
formDataFormDataCollectionThe form data.
typeTypeThe type of the object.
modelNamestringThe name of the model.
requiredMemberSelectorIRequiredMemberSelectorThe required member selector.
formatterLoggerIFormatterLoggerThe 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
formDataFormDataCollectioncollection with parsed form url data
typeTypetarget type to read as
modelNamestringnull 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.
requiredMemberSelectorIRequiredMemberSelectorThe System.Net.Http.Formatting.IRequiredMemberSelector used to determine required members.
formatterLoggerIFormatterLoggerThe System.Net.Http.Formatting.IFormatterLogger to log events to.
configHttpConfigurationThe 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
formDataFormDataCollectiontypeTypemodelNamestringactionContextHttpActionContext
Returns
ReadAs(FormDataCollection, Type, HttpActionContext)
public static object ReadAs(this FormDataCollection formData, Type type, HttpActionContext actionContext)
Parameters
formDataFormDataCollectiontypeTypeactionContextHttpActionContext
Returns
ReadAs<T>(FormDataCollection)
Reads the collection extensions with specified type.
public static T ReadAs<T>(this FormDataCollection formData)
Parameters
formDataFormDataCollectionThe form data.
Returns
- T
The read collection extensions.
Type Parameters
TThe 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
formDataFormDataCollectionThe form data.
modelNamestringThe name of the model.
requiredMemberSelectorIRequiredMemberSelectorThe required member selector.
formatterLoggerIFormatterLoggerThe formatter logger.
Returns
- T
The collection extensions.
Type Parameters
TThe generic type.
ReadAs<T>(FormDataCollection, string, HttpActionContext)
public static T ReadAs<T>(this FormDataCollection formData, string modelName, HttpActionContext actionContext)
Parameters
formDataFormDataCollectionmodelNamestringactionContextHttpActionContext
Returns
- T
Type Parameters
T
ReadAs<T>(FormDataCollection, HttpActionContext)
public static T ReadAs<T>(this FormDataCollection formData, HttpActionContext actionContext)
Parameters
formDataFormDataCollectionactionContextHttpActionContext
Returns
- T
Type Parameters
T