-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ma/site-settings-extensions
- Loading branch information
Showing
9 changed files
with
70 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
src/OrchardCore/OrchardCore.Mvc.Core/Routing/IAreaControllerRouteMapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
using Microsoft.AspNetCore.Mvc.Controllers; | ||
using Microsoft.AspNetCore.Routing; | ||
|
||
namespace OrchardCore.Mvc.Routing | ||
namespace OrchardCore.Mvc.Routing; | ||
|
||
public interface IAreaControllerRouteMapper | ||
{ | ||
public interface IAreaControllerRouteMapper | ||
{ | ||
int Order { get; } | ||
bool TryMapAreaControllerRoute(IEndpointRouteBuilder routes, ControllerActionDescriptor descriptor); | ||
} | ||
int Order { get; } | ||
bool TryMapAreaControllerRoute(IEndpointRouteBuilder routes, ControllerActionDescriptor descriptor); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/OrchardCore/OrchardCore.Mvc.Core/Routing/RoutingHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.AspNetCore.Mvc.Controllers; | ||
|
||
namespace OrchardCore.Mvc.Routing; | ||
|
||
public static class RoutingHelper | ||
{ | ||
public static string ReplaceMvcPlaceholders(string name, string area, string controller, string action) => | ||
name? | ||
.Replace("{area}", area) | ||
.Replace("{controller}", controller) | ||
.Replace("{action}", action); | ||
|
||
public static (string Area, string Controller, string Action) GetMvcRouteValues(ControllerActionDescriptor descriptor) | ||
{ | ||
var area = descriptor.RouteValues["area"]; | ||
|
||
return (area, descriptor.ControllerName, descriptor.ActionName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters