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
TModelThe 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
locatorstringThe string to use when locating the View Component.
viewNamestringThe 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
renderingContextISitecoreRenderingContextThe current ISitecoreRenderingContext.
viewContextViewContextThe current ViewContext.
Returns
- Task<IHtmlContent>
The HTML content to render.