Export (0) Print
Expand All

HttpActionContextExtensions.TryBindStrongModel<TModel> Method

Binds the model to the property by using the specified execution context and binding context.

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

public static bool TryBindStrongModel<TModel>(
	this HttpActionContext actionContext,
	ModelBindingContext parentBindingContext,
	string propertyName,
	ModelMetadataProvider metadataProvider,
	out TModel model
)

Type Parameters

TModel

The type of the model.

Parameters

actionContext
Type: System.Web.Http.Controllers.HttpActionContext

The execution context.

parentBindingContext
Type: System.Web.Http.ModelBinding.ModelBindingContext

The parent binding context.

propertyName
Type: System.String

The name of the property to bind with the model.

metadataProvider
Type: System.Web.Http.Metadata.ModelMetadataProvider

The metadata provider for the model.

model
Type: TModel%

When this method returns, contains the bound model.

Return Value

Type: System.Boolean
true if the bind succeeded; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpActionContext. 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).aspx or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).aspx.
Show:
© 2015 Microsoft