Table of Contents

Class ViewComponentComponentRenderer

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

An IComponentRenderer that will render View Components.

public class ViewComponentComponentRenderer : IComponentRenderer
Inheritance
ViewComponentComponentRenderer
Implements
Inherited Members

Constructors

ViewComponentComponentRenderer(string)

Initializes a new instance of the ViewComponentComponentRenderer class.

public ViewComponentComponentRenderer(string locator)

Parameters

locator string

The string to use when locating the View Component.

Methods

Describe(Predicate<string>, string)

Creates an instance of a ComponentRendererDescriptor for the ViewComponentComponentRenderer class.

public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)

Parameters

match Predicate<string>

A predicate to use when attempting to match a layout component.

locator string

The string to use when locating the View Component.

Returns

ComponentRendererDescriptor

An instance of ComponentRendererDescriptor.

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.