Class SitecoreComponentViewComponent
- Namespace
- Sitecore.AspNetCore.SDK.RenderingEngine.ViewComponents
- Assembly
- Sitecore.AspNetCore.SDK.RenderingEngine.dll
Default view with model binding to render components.
[ViewComponent]
public class SitecoreComponentViewComponent : BindingViewComponent
- Inheritance
-
SitecoreComponentViewComponent
- Inherited Members
Remarks
Initializes a new instance of the SitecoreComponentViewComponent class.
Constructors
SitecoreComponentViewComponent(IViewModelBinder)
Default view with model binding to render components.
public SitecoreComponentViewComponent(IViewModelBinder binder)
Parameters
binder
IViewModelBinderThe IViewModelBinder to use when binding the model to the view component.
Remarks
Initializes a new instance of the SitecoreComponentViewComponent class.
Methods
InvokeAsync(Type, string)
Executes the view component.
public Task<IViewComponentResult> InvokeAsync(Type modelType, string viewName)
Parameters
modelType
TypeThe type of the model to use when generating the view component output.
viewName
stringThe name of the view to use when generating the view component output.
Returns
- Task<IViewComponentResult>
A Task<TResult> representing the result of the asynchronous operation.