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
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
public static IEndpointConventionBuilder MapSitecoreLocalizedRoute(this IEndpointRouteBuilder endpoints, string routeName, string action, string controller)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Routing.IEndpointRouteBuilderendpointsMicrosoft.AspNetCore.Routing.IEndpointRouteBuilder parameter.
System.StringrouteNameName of the route.
System.StringactionDefault action.
System.StringcontrollerDefault controller.
Returns
TypeDescription
Microsoft.AspNetCore.Builder.IEndpointConventionBuilderAn Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder for endpoints associated with controller actions for this route.
If you have suggestions for improving this article, let us know!