Ensures the culture is set for requests for both front-end and back office

This commit is contained in:
Shannon
2021-01-08 11:29:07 +11:00
parent b4922d2685
commit c15b416e88
10 changed files with 94 additions and 24 deletions

View File

@@ -1,24 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Common.ModelBinders;
namespace Umbraco.Web.Common.AspNetCore
{
/// <summary>
/// Options for globally configuring MVC for Umbraco
/// </summary>
/// <remarks>
/// We generally don't want to change the global MVC settings since we want to be unobtrusive as possible but some
/// global mods are needed - so long as they don't interfere with normal user usages of MVC.
/// </remarks>
public class UmbracoMvcConfigureOptions : IConfigureOptions<MvcOptions>
{
/// <inheritdoc/>
public void Configure(MvcOptions options)
{
options.ModelBinderProviders.Insert(0, new ContentModelBinderProvider());
options.Filters.Insert(0, new EnsurePartialViewMacroViewContextFilterAttribute());
}
}
}