ParameterBindingExtensions.BindWithFormatter Method (HttpParameterDescriptor, IEnumerable<MediaTypeFormatter>, IBodyModelValidator)
Binds parameter by parsing the HTTP body content.
Namespace: System.Web.Http.Controllers
Assembly: System.Web.Http (in System.Web.Http.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function BindWithFormatter ( _
parameter As HttpParameterDescriptor, _
formatters As IEnumerable(Of MediaTypeFormatter), _
bodyModelValidator As IBodyModelValidator _
) As HttpParameterBinding
'Usage
Dim parameter As HttpParameterDescriptor
Dim formatters As IEnumerable(Of MediaTypeFormatter)
Dim bodyModelValidator As IBodyModelValidator
Dim returnValue As HttpParameterBinding
returnValue = parameter.BindWithFormatter(formatters, _
bodyModelValidator)
public static HttpParameterBinding BindWithFormatter(
this HttpParameterDescriptor parameter,
IEnumerable<MediaTypeFormatter> formatters,
IBodyModelValidator bodyModelValidator
)
[ExtensionAttribute]
public:
static HttpParameterBinding^ BindWithFormatter(
HttpParameterDescriptor^ parameter,
IEnumerable<MediaTypeFormatter^>^ formatters,
IBodyModelValidator^ bodyModelValidator
)
static member BindWithFormatter :
parameter:HttpParameterDescriptor *
formatters:IEnumerable<MediaTypeFormatter> *
bodyModelValidator:IBodyModelValidator -> HttpParameterBinding
public static function BindWithFormatter(
parameter : HttpParameterDescriptor,
formatters : IEnumerable<MediaTypeFormatter>,
bodyModelValidator : IBodyModelValidator
) : HttpParameterBinding
Parameters
parameter
Type: System.Web.Http.Controllers.HttpParameterDescriptorThe parameter descriptor that describes the parameter to bind.
formatters
Type: System.Collections.Generic.IEnumerable<MediaTypeFormatter>The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object.
bodyModelValidator
Type: System.Web.Http.Validation.IBodyModelValidatorThe body model validator used to validate the parameter.
Return Value
Type: System.Web.Http.Controllers.HttpParameterBinding
The HTTP parameter binding object.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HttpParameterDescriptor. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).