// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.Infrastructure { internal class MvcOptionsConfigureCompatibilityOptions : ConfigureCompatibilityOptions { public MvcOptionsConfigureCompatibilityOptions( ILoggerFactory loggerFactory, IOptions compatibilityOptions) : base(loggerFactory, compatibilityOptions) { } protected override IReadOnlyDictionary DefaultValues { get { var values = new Dictionary(); if (Version >= CompatibilityVersion.Version_2_1) { values[nameof(MvcOptions.AllowCombiningAuthorizeFilters)] = true; values[nameof(MvcOptions.InputFormatterExceptionPolicy)] = InputFormatterExceptionPolicy.MalformedInputExceptions; values[nameof(MvcOptions.SuppressBindingUndefinedValueToEnumType)] = true; } return values; } } } }