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, string)

Creates an instance of a ComponentRendererDescriptor for the ViewComponentComponentRenderer class.

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

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.

componentName string

The string to use describe the name of the components.

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.