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

@@ -30,8 +30,8 @@ namespace Umbraco.Web.Common.ModelBinders
// only IPublishedContent will ever exist in the request so when this model binder is used as an IModelBinder
// in the aspnet pipeline it will really only support converting from IPublishedContent which is contained
// in the UmbracoRouteValues --> IContentModel
if (!bindingContext.ActionContext.RouteData.Values.TryGetValue(Core.Constants.Web.UmbracoRouteDefinitionDataToken, out var source)
|| !(source is UmbracoRouteValues umbracoRouteValues))
UmbracoRouteValues umbracoRouteValues = bindingContext.HttpContext.Features.Get<UmbracoRouteValues>();
if (umbracoRouteValues == null)
{
return Task.CompletedTask;
}