Class RenderingEngineMiddleware

Version: 21.x

The Rendering Engine middleware implementation that calls the Sitecore layout service and stores the ISitecoreRenderingContext as a Microsoft.AspNetCore.Http.HttpContext feature.

Inheritance
System.Object
RenderingEngineMiddleware
Namespace: Sitecore.AspNet.RenderingEngine.Middleware
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
RequestResponse
public class RenderingEngineMiddleware : Object

Constructors

RenderingEngineMiddleware(RequestDelegate, ISitecoreLayoutRequestMapper, ISitecoreLayoutClient, IOptions<RenderingEngineOptions>)

Initializes a new instance of the RenderingEngineMiddleware class.

Declaration
RequestResponse
public RenderingEngineMiddleware(RequestDelegate next, ISitecoreLayoutRequestMapper requestMapper, ISitecoreLayoutClient layoutService, IOptions<RenderingEngineOptions> options)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Http.RequestDelegatenext

The next middleware to call.

ISitecoreLayoutRequestMapperrequestMapper

The ISitecoreLayoutRequestMapper to map the HttpRequest to a Layout Service request.

ISitecoreLayoutClientlayoutService

The layout service client.

Microsoft.Extensions.Options.IOptions<RenderingEngineOptions>options

Rendering Engine options.

Methods

Invoke(HttpContext, IViewComponentHelper, IHtmlHelper)

The middleware Invoke method.

Declaration
RequestResponse
public Task Invoke(HttpContext httpContext, IViewComponentHelper viewComponentHelper, IHtmlHelper htmlHelper)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Http.HttpContexthttpContext

The current Microsoft.AspNetCore.Http.HttpContext.

Microsoft.AspNetCore.Mvc.IViewComponentHelperviewComponentHelper

The current Microsoft.AspNetCore.Mvc.IViewComponentHelper.

Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelperhtmlHelper

The current Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper.

Returns
TypeDescription
System.Threading.Tasks.Task

A System.Threading.Tasks.Task to support async calls.

Do you have some feedback for us?

If you have suggestions for improving this article,