Class RenderingEngineMiddleware
The Rendering Engine middleware implementation that calls the Sitecore layout service and stores the ISitecoreRenderingContext as a Microsoft.AspNetCore.Http.HttpContext feature.
Inheritance
Namespace: Sitecore.AspNet.RenderingEngine.Middleware
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public class RenderingEngineMiddleware : ObjectConstructors
RenderingEngineMiddleware(RequestDelegate, ISitecoreLayoutRequestMapper, ISitecoreLayoutClient, IOptions<RenderingEngineOptions>)
Initializes a new instance of the RenderingEngineMiddleware class.
Declaration
public RenderingEngineMiddleware(RequestDelegate next, ISitecoreLayoutRequestMapper requestMapper, ISitecoreLayoutClient layoutService, IOptions<RenderingEngineOptions> options)Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.RequestDelegate | next |
The next middleware to call. |
| ISitecoreLayoutRequestMapper | requestMapper |
The ISitecoreLayoutRequestMapper to map the HttpRequest to a Layout Service request. |
| ISitecoreLayoutClient | layoutService |
The layout service client. |
| Microsoft.Extensions.Options.IOptions<RenderingEngineOptions> | options |
Rendering Engine options. |
Methods
Invoke(HttpContext, IViewComponentHelper, IHtmlHelper)
The middleware Invoke method.
Declaration
public Task Invoke(HttpContext httpContext, IViewComponentHelper viewComponentHelper, IHtmlHelper htmlHelper)Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.HttpContext | httpContext |
The current Microsoft.AspNetCore.Http.HttpContext. |
| Microsoft.AspNetCore.Mvc.IViewComponentHelper | viewComponentHelper |
The current Microsoft.AspNetCore.Mvc.IViewComponentHelper. |
| Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper | htmlHelper |
The current Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
A System.Threading.Tasks.Task to support async calls. |