Class ControllerEndpointExtensions

Version: 21.x

Contains extension methods for using Controllers with Microsoft.AspNetCore.Routing.IEndpointRouteBuilder.

Inheritance
System.Object
ControllerEndpointExtensions
Namespace: Sitecore.AspNet.RenderingEngine.Localization
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
RequestResponse
public static class ControllerEndpointExtensions : Object

Methods

MapSitecoreLocalizedRoute(IEndpointRouteBuilder, String, String, String)

Add default endpoint which supports language embedded prefixes. Like Http://localhost/da-DK/home.

Declaration
RequestResponse
public static IEndpointConventionBuilder MapSitecoreLocalizedRoute(this IEndpointRouteBuilder endpoints, string routeName, string action, string controller)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Routing.IEndpointRouteBuilderendpoints

Microsoft.AspNetCore.Routing.IEndpointRouteBuilder parameter.

System.StringrouteName

Name of the route.

System.Stringaction

Default action.

System.Stringcontroller

Default controller.

Returns
TypeDescription
Microsoft.AspNetCore.Builder.IEndpointConventionBuilder

An Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder for endpoints associated with controller actions for this route.

Do you have some feedback for us?

If you have suggestions for improving this article,