Commit 762d229
committed
Introduced
The existing `MapTopicAreaRoute()` extension method recently introduced (6c6ad74) requires, at minimum, an `areaName` parameter, and thus is limited to setting up routes for one individual area at a time.
This extension doesn't (currently) accept any parameters, and will instead map _all_ areas to support the `{**path}` catch-all expected by the OnTopic CMS. It does this by implementing the new `TopicRouteValueTransformer` (865f26a) to automatically set the `controller` and the `rootTopic` routing variables to the `area` name, which is the convention we most frequently follow.
As part of this, I also registered `TopicRouteValueTransformer` with ASP.NET Core dependent injection, as part of the `AddTopicSupport()` extension.
Be aware that this implementation trips of a feature limitation of ASP.NET Core 3.0 which prevents e.g. `@Url.Action()` references from correctly returning values (see dotnet/aspnetcore#16965). Hopefully that will be resolved in ASP.NET 4.0.MapTopicAreaRoute() overload for mapping all areas1 parent 8a65c95 commit 762d229
1 file changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| |||
0 commit comments