Replace surface with area name if surface controller has one
This commit is contained in:
@@ -122,5 +122,27 @@ namespace Umbraco.Extensions
|
||||
true,
|
||||
constraints);
|
||||
}
|
||||
|
||||
public static void MapUmbracoSurfaceRoute(
|
||||
this IEndpointRouteBuilder endpoints,
|
||||
Type controllerType,
|
||||
string rootSegment,
|
||||
string areaName,
|
||||
string defaultAction = "Index",
|
||||
bool includeControllerNameInRoute = true,
|
||||
object constraints = null)
|
||||
{
|
||||
// If there is an area name it's a plugin controller, and we should use the area name instead of surface
|
||||
string prefixPathSegment = areaName.IsNullOrWhiteSpace() ? "Surface" : areaName;
|
||||
|
||||
endpoints.MapUmbracoRoute(
|
||||
controllerType,
|
||||
rootSegment,
|
||||
areaName,
|
||||
prefixPathSegment,
|
||||
defaultAction,
|
||||
includeControllerNameInRoute,
|
||||
constraints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user