From 7aff288ff1725dd481ed5c112a10026e48a8ce9c Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Fri, 5 Feb 2021 12:32:09 +1100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Bjarke Berg --- .../Extensions/EndpointRouteBuilderExtensions.cs | 2 +- src/Umbraco.Web.Common/ModelBinders/ContentModelBinder.cs | 2 +- src/Umbraco.Web.Website/Controllers/SurfaceController.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.Common/Extensions/EndpointRouteBuilderExtensions.cs b/src/Umbraco.Web.Common/Extensions/EndpointRouteBuilderExtensions.cs index 37495c5ff5..7ebb2f71c1 100644 --- a/src/Umbraco.Web.Common/Extensions/EndpointRouteBuilderExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/EndpointRouteBuilderExtensions.cs @@ -37,7 +37,7 @@ namespace Umbraco.Web.Common.Extensions pattern.Append('/').Append(controllerName); } - pattern.Append('/').Append("{action}/{id?}"); + pattern.Append("/{action}/{id?}"); var defaults = defaultAction.IsNullOrWhiteSpace() ? (object)new { controller = controllerName } diff --git a/src/Umbraco.Web.Common/ModelBinders/ContentModelBinder.cs b/src/Umbraco.Web.Common/ModelBinders/ContentModelBinder.cs index b93978693b..e3aabe71be 100644 --- a/src/Umbraco.Web.Common/ModelBinders/ContentModelBinder.cs +++ b/src/Umbraco.Web.Common/ModelBinders/ContentModelBinder.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.Common.ModelBinders // in the aspnet pipeline it will really only support converting from IPublishedContent which is contained // in the UmbracoRouteValues --> IContentModel UmbracoRouteValues umbracoRouteValues = bindingContext.HttpContext.Features.Get(); - if (umbracoRouteValues == null) + if (umbracoRouteValues is null) { return Task.CompletedTask; } diff --git a/src/Umbraco.Web.Website/Controllers/SurfaceController.cs b/src/Umbraco.Web.Website/Controllers/SurfaceController.cs index 4db3c605c9..6306695391 100644 --- a/src/Umbraco.Web.Website/Controllers/SurfaceController.cs +++ b/src/Umbraco.Web.Website/Controllers/SurfaceController.cs @@ -41,7 +41,7 @@ namespace Umbraco.Web.Website.Controllers get { UmbracoRouteValues umbracoRouteValues = HttpContext.Features.Get(); - if (umbracoRouteValues == null) + if (umbracoRouteValues is null) { throw new InvalidOperationException($"No {nameof(UmbracoRouteValues)} feature was found in the HttpContext"); }