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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
message
stringThe 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
parameter
HttpParameterDescriptorThe parameter to provide binding for.
attribute
ParameterBindingAttributeThe 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
parameter
HttpParameterDescriptorThe 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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formatters
IEnumerable<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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formatters
IEnumerable<MediaTypeFormatter>The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object.
bodyModelValidator
IBodyModelValidatorThe 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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formatters
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.
BindWithModelBinding(HttpParameterDescriptor)
Binds parameter by parsing the query string.
public static HttpParameterBinding BindWithModelBinding(this HttpParameterDescriptor parameter)
Parameters
parameter
HttpParameterDescriptorThe 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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
valueProviderFactories
IEnumerable<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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
binder
IModelBinderThe 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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
binder
IModelBinderThe model binder used to assemble the parameter into an object.
valueProviderFactories
IEnumerable<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
parameter
HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
valueProviderFactories
ValueProviderFactory[]The value provider factories which provide query string parameter data.
Returns
- HttpParameterBinding
The HTTP parameter binding object.