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
public class RenderingEngineMiddleware : Object

Constructors

RenderingEngineMiddleware(RequestDelegate, ISitecoreLayoutRequestMapper, ISitecoreLayoutClient, IOptions)

Initializes a new instance of the RenderingEngineMiddleware class.

Declaration
public RenderingEngineMiddleware(RequestDelegate next, ISitecoreLayoutRequestMapper requestMapper, ISitecoreLayoutClient layoutService, IOptions<RenderingEngineOptions> options)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Http.RequestDelegatenextThe next middleware to call.
ISitecoreLayoutRequestMapperrequestMapperThe ISitecoreLayoutRequestMapper to map the HttpRequest to a Layout Service request.
ISitecoreLayoutClientlayoutServiceThe layout service client.
Microsoft.Extensions.Options.IOptions

<

RenderingEngineOptions

>
optionsRendering Engine options.

Methods

Invoke(HttpContext, IViewComponentHelper, IHtmlHelper)

The middleware Invoke method.

Declaration
public Task Invoke(HttpContext httpContext, IViewComponentHelper viewComponentHelper, IHtmlHelper htmlHelper)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Http.HttpContexthttpContextThe current Microsoft.AspNetCore.Http.HttpContext.
Microsoft.AspNetCore.Mvc.IViewComponentHelperviewComponentHelperThe current Microsoft.AspNetCore.Mvc.IViewComponentHelper.
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelperhtmlHelperThe current Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper.
Returns
TypeDescription
System.Threading.Tasks.TaskA System.Threading.Tasks.Task to support async calls.
If you have suggestions for improving this article, let us know!