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 : ObjectMethods
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
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Routing.IEndpointRouteBuilder | endpoints |
Microsoft.AspNetCore.Routing.IEndpointRouteBuilder parameter. |
| System.String | routeName |
Name of the route. |
| System.String | action |
Default action. |
| System.String | controller |
Default controller. |
Returns
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Builder.IEndpointConventionBuilder |
An Microsoft.AspNetCore.Builder.ControllerActionEndpointConventionBuilder for endpoints associated with controller actions for this route. |