Table of Contents

Class ModelBoundViewComponentComponentRenderer<TModel>

Namespace
Sitecore.AspNetCore.SDK.RenderingEngine.Rendering
Assembly
Sitecore.AspNetCore.SDK.RenderingEngine.dll

An IComponentRenderer that will render View Components that are bound to a specified Model type.

public class ModelBoundViewComponentComponentRenderer<TModel> : IComponentRenderer

Type Parameters

TModel

The model type to bind to the View Component.

Inheritance
ModelBoundViewComponentComponentRenderer<TModel>
Implements
Inherited Members

Constructors

ModelBoundViewComponentComponentRenderer(string, string)

Initializes a new instance of the ModelBoundViewComponentComponentRenderer<TModel> class.

public ModelBoundViewComponentComponentRenderer(string locator, string viewName)

Parameters

locator string

The string to use when locating the View Component.

viewName string

The name of the view to use when rendering.

Methods

Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)

Parameters

renderingContext ISitecoreRenderingContext

The current ISitecoreRenderingContext.

viewContext ViewContext

The current ViewContext.

Returns

Task<IHtmlContent>

The HTML content to render.