Changes the umbraco route values to use http features intead of in route values which is much nicer, fixes the redirect to page result, tests a surface controller POST and it works, ensures the routing takes place before the form check, removes a bunch of old code

This commit is contained in:
Shannon
2021-02-03 15:47:27 +11:00
parent 2dc169457b
commit 0c26a82489
28 changed files with 313 additions and 902 deletions

View File

@@ -71,11 +71,11 @@ namespace Umbraco.Web.Common.Controllers
return _umbracoRouteValues;
}
_umbracoRouteValues = HttpContext.GetRouteValue(Core.Constants.Web.UmbracoRouteDefinitionDataToken) as UmbracoRouteValues;
_umbracoRouteValues = HttpContext.Features.Get<UmbracoRouteValues>();
if (_umbracoRouteValues == null)
{
throw new InvalidOperationException($"No route value found with key {Core.Constants.Web.UmbracoRouteDefinitionDataToken}");
throw new InvalidOperationException($"No {nameof(UmbracoRouteValues)} feature was found in the HttpContext");
}
return _umbracoRouteValues;