Class ParameterBindingExtensions
- Namespace
- System.Web.Http.Controllers
- Assembly
- System.Web.Http.dll
Defines extension methods for HttpParameterBinding.
public static class ParameterBindingExtensions
- Inheritance
-
ParameterBindingExtensions
- Inherited Members
Methods
BindAsError(HttpParameterDescriptor, string)
Binds parameter that results as an error.
public static HttpParameterBinding BindAsError(this HttpParameterDescriptor parameter, string message)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
messagestringThe error message that describes the reason for fail bind.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithAttribute(HttpParameterDescriptor, ParameterBindingAttribute)
Bind the parameter as if it had the given attribute on the declaration.
public static HttpParameterBinding BindWithAttribute(this HttpParameterDescriptor parameter, ParameterBindingAttribute attribute)
Parameters
parameterHttpParameterDescriptorThe parameter to provide binding for.
attributeParameterBindingAttributeThe attribute that describes the binding.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithFormatter(HttpParameterDescriptor)
Binds parameter by parsing the HTTP body content.
public static HttpParameterBinding BindWithFormatter(this HttpParameterDescriptor parameter)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithFormatter(HttpParameterDescriptor, IEnumerable<MediaTypeFormatter>)
Binds parameter by parsing the HTTP body content.
public static HttpParameterBinding BindWithFormatter(this HttpParameterDescriptor parameter, IEnumerable<MediaTypeFormatter> formatters)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formattersIEnumerable<MediaTypeFormatter>The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithFormatter(HttpParameterDescriptor, IEnumerable<MediaTypeFormatter>, IBodyModelValidator)
Binds parameter by parsing the HTTP body content.
public static HttpParameterBinding BindWithFormatter(this HttpParameterDescriptor parameter, IEnumerable<MediaTypeFormatter> formatters, IBodyModelValidator bodyModelValidator)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formattersIEnumerable<MediaTypeFormatter>The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object.
bodyModelValidatorIBodyModelValidatorThe body model validator used to validate the parameter.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithFormatter(HttpParameterDescriptor, params MediaTypeFormatter[])
Binds parameter by parsing the HTTP body content.
public static HttpParameterBinding BindWithFormatter(this HttpParameterDescriptor parameter, params MediaTypeFormatter[] formatters)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formattersMediaTypeFormatter[]The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithModelBinding(HttpParameterDescriptor)
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithModelBinding(HttpParameterDescriptor, IEnumerable<ValueProviderFactory>)
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter, IEnumerable<ValueProviderFactory> valueProviderFactories)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
valueProviderFactoriesIEnumerable<ValueProviderFactory>The value provider factories which provide query string parameter data.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithModelBinding(HttpParameterDescriptor, IModelBinder)
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter, IModelBinder binder)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
binderIModelBinderThe model binder used to assemble the parameter into an object.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithModelBinding(HttpParameterDescriptor, IModelBinder, IEnumerable<ValueProviderFactory>)
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter, IModelBinder binder, IEnumerable<ValueProviderFactory> valueProviderFactories)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
binderIModelBinderThe model binder used to assemble the parameter into an object.
valueProviderFactoriesIEnumerable<ValueProviderFactory>The value provider factories which provide query string parameter data.
Returns
- HttpParameterBinding
The HTTP parameter binding object.
BindWithModelBinding(HttpParameterDescriptor, params ValueProviderFactory[])
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter, params ValueProviderFactory[] valueProviderFactories)
Parameters
parameterHttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
valueProviderFactoriesValueProviderFactory[]The value provider factories which provide query string parameter data.
Returns
- HttpParameterBinding
The HTTP parameter binding object.