Class BindingViewComponent
Provides delayed binding for a Microsoft.AspNetCore.Mvc.ViewComponent.
Namespace: Sitecore.AspNet.RenderingEngine.Mvc
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
Constructors
BindingViewComponent(IViewModelBinder)
Initializes a new instance of the BindingViewComponent class.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IViewModelBinder | binder |
The IViewModelBinder to enable binding. |
Properties
Binder
Gets the instance of IViewModelBinder used for binding.
Declaration
Property Value
| Type | Description |
|---|---|
| IViewModelBinder |
Methods
BindView(Type, String)
Returns the specified view bound to the given model type.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | modelType |
The model type to be used for binding. |
| System.String | viewName |
The view to be returned. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IViewComponentResult> |
The Microsoft.AspNetCore.Mvc.IViewComponentResult. |
BindView<TModel>()
Returns the default view using a bound model of TModel.
Declaration
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IViewComponentResult> |
The Microsoft.AspNetCore.Mvc.IViewComponentResult. |
Type Parameters
| Name | Description |
|---|---|
| TModel |
The model to be bound. |
BindView<TModel>(TModel)
Returns the default view bound to the given model.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| TModel | model |
An instance of |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IViewComponentResult> |
The Microsoft.AspNetCore.Mvc.IViewComponentResult. |
Type Parameters
| Name | Description |
|---|---|
| TModel |
The model to be bound. |
BindView<TModel>(String)
Returns the specified view using a bound model of TModel.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | viewName |
The view to be returned. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IViewComponentResult> |
The Microsoft.AspNetCore.Mvc.IViewComponentResult. |
Type Parameters
| Name | Description |
|---|---|
| TModel |
The model to be bound. |
BindView<TModel>(String, TModel)
Returns the specified view bound to the given model.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | viewName |
The view to be returned. |
| TModel | model |
An instance of |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IViewComponentResult> |
The Microsoft.AspNetCore.Mvc.IViewComponentResult. |
Type Parameters
| Name | Description |
|---|---|
| TModel |
The model to be bound. |