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
stringThe string to use when locating the View Component.
viewName
stringThe 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
ISitecoreRenderingContextThe current ISitecoreRenderingContext.
viewContext
ViewContextThe current ViewContext.
Returns
- Task<IHtmlContent>
The HTML content to render.