diff --git a/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotStatus.cs b/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotStatus.cs index c8975844ef..dff40275d8 100644 --- a/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotStatus.cs +++ b/src/Umbraco.PublishedCache.NuCache/PublishedSnapshotStatus.cs @@ -1,4 +1,4 @@ -using Umbraco.Infrastructure.PublishedCache.Persistence; +using Umbraco.Infrastructure.PublishedCache.Persistence; namespace Umbraco.Web.PublishedCache.NuCache { @@ -26,26 +26,28 @@ namespace Umbraco.Web.PublishedCache.NuCache var dbCacheIsOk = _publishedContentService.VerifyContentDbCache() && _publishedContentService.VerifyMediaDbCache() - && _publishedContentService.VerifyMemberDbCache(); + && _publishedContentService.VerifyMemberDbCache() + ? "ok" + : "NOT ok (rebuild?)"; ContentStore contentStore = _service.GetContentStore(); ContentStore mediaStore = _service.GetMediaStore(); - var cg = contentStore.GenCount; - var mg = mediaStore.GenCount; - var cs = contentStore.SnapCount; - var ms = mediaStore.SnapCount; - var ce = contentStore.Count; - var me = mediaStore.Count; + var contentStoreGen = contentStore.GenCount; + var mediaStoreGen = mediaStore.GenCount; + var contentStoreSnap = contentStore.SnapCount; + var mediaStoreSnap = mediaStore.SnapCount; + var contentStoreCount = contentStore.Count; + var mediaStoreCount = mediaStore.Count; - return - " Database cache is " + (dbCacheIsOk ? "ok" : "NOT ok (rebuild?)") + "." + - " ContentStore contains " + ce + " item" + (ce > 1 ? "s" : "") + - " and has " + cg + " generation" + (cg > 1 ? "s" : "") + - " and " + cs + " snapshot" + (cs > 1 ? "s" : "") + "." + - " MediaStore contains " + me + " item" + (ce > 1 ? "s" : "") + - " and has " + mg + " generation" + (mg > 1 ? "s" : "") + - " and " + ms + " snapshot" + (ms > 1 ? "s" : "") + "."; + string contentStoreCountPlural = contentStoreCount > 1 ? "s" : string.Empty; + string contentStoreGenPlural = contentStoreGen > 1 ? "s" : string.Empty; + string contentStoreSnapPlural = contentStoreSnap > 1 ? "s" : string.Empty; + string mediaStoreCountPlural = mediaStoreCount > 1 ? "s" : string.Empty; + string mediaStoreGenPlural = mediaStoreGen > 1 ? "s" : string.Empty; + string mediaStoreSnapPlural = mediaStoreSnap > 1 ? "s" : string.Empty; + + return $" Database cache is {dbCacheIsOk}. ContentStore contains {contentStoreCount} item{contentStoreCountPlural} and has {contentStoreGen} generation{contentStoreGenPlural} and {contentStoreSnap} snapshot{contentStoreSnapPlural}. MediaStore contains {mediaStoreCount} item{mediaStoreCountPlural} and has {mediaStoreGen} generation{mediaStoreGenPlural} and {mediaStoreSnap} snapshot{mediaStoreSnapPlural}."; } } } diff --git a/src/Umbraco.Web.Common/ApplicationModels/UmbracoJsonModelBinderConvention.cs b/src/Umbraco.Web.Common/ApplicationModels/UmbracoJsonModelBinderConvention.cs index 42d23b33b3..5a9e3ff90d 100644 --- a/src/Umbraco.Web.Common/ApplicationModels/UmbracoJsonModelBinderConvention.cs +++ b/src/Umbraco.Web.Common/ApplicationModels/UmbracoJsonModelBinderConvention.cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Mvc.ModelBinding; -using Umbraco.Web.Common.ModelBinding; using System.Linq; using Umbraco.Web.Common.Attributes; using Umbraco.Web.Actions; using Umbraco.Web.Common.Filters; +using Umbraco.Web.Common.ModelBinders; namespace Umbraco.Web.Common.ApplicationModels { diff --git a/src/Umbraco.Web.Common/ModelBinding/UmbracoJsonModelBinderProvider.cs b/src/Umbraco.Web.Common/ModelBinders/UmbracoJsonModelBinder.cs similarity index 96% rename from src/Umbraco.Web.Common/ModelBinding/UmbracoJsonModelBinderProvider.cs rename to src/Umbraco.Web.Common/ModelBinders/UmbracoJsonModelBinder.cs index 7ec61656fb..7069344bda 100644 --- a/src/Umbraco.Web.Common/ModelBinding/UmbracoJsonModelBinderProvider.cs +++ b/src/Umbraco.Web.Common/ModelBinders/UmbracoJsonModelBinder.cs @@ -1,14 +1,14 @@ -using Microsoft.AspNetCore.Mvc; +using System.Buffers; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.ObjectPool; -using System.Buffers; using Umbraco.Web.Common.Formatters; -namespace Umbraco.Web.Common.ModelBinding +namespace Umbraco.Web.Common.ModelBinders { /// /// A custom body model binder that only uses a to bind body action parameters diff --git a/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs b/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs index 508f4e987f..49dcf5a6db 100644 --- a/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs +++ b/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs @@ -16,7 +16,6 @@ using Umbraco.Web.Common.Install; using Umbraco.Web.Common.Lifetime; using Umbraco.Web.Common.Macros; using Umbraco.Web.Common.Middleware; -using Umbraco.Web.Common.ModelBinding; using Umbraco.Web.Common.Profiler; using Umbraco.Web.Common.Routing; using Umbraco.Web.Common.Security; @@ -25,6 +24,7 @@ using Umbraco.Web.Composing.CompositionExtensions; using Umbraco.Web.Macros; using Umbraco.Web.Security; using Umbraco.Web.Templates; +using Umbraco.Web.Common.ModelBinders; namespace Umbraco.Web.Common.Runtime {