Ensures the culture is set for requests for both front-end and back office
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user