Table of Contents

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 IViewModelBinder

The 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 Type

The type of the model to use when generating the view component output.

viewName string

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