Freigeben über


ParameterBindingExtensions.BindWithAttribute Method

Bind the parameter as if it had the given attribute on the declaration.

Namespace:  System.Web.Http.Controllers
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function BindWithAttribute ( _
    parameter As HttpParameterDescriptor, _
    attribute As ParameterBindingAttribute _
) As HttpParameterBinding
'Usage
Dim parameter As HttpParameterDescriptor 
Dim attribute As ParameterBindingAttribute 
Dim returnValue As HttpParameterBinding 

returnValue = parameter.BindWithAttribute(attribute)
public static HttpParameterBinding BindWithAttribute(
    this HttpParameterDescriptor parameter,
    ParameterBindingAttribute attribute
)
[ExtensionAttribute]
public:
static HttpParameterBinding^ BindWithAttribute(
    HttpParameterDescriptor^ parameter, 
    ParameterBindingAttribute^ attribute
)
static member BindWithAttribute : 
        parameter:HttpParameterDescriptor * 
        attribute:ParameterBindingAttribute -> HttpParameterBinding
public static function BindWithAttribute(
    parameter : HttpParameterDescriptor, 
    attribute : ParameterBindingAttribute
) : HttpParameterBinding

Parameters

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).

See Also

Reference

ParameterBindingExtensions Class

System.Web.Http.Controllers Namespace