From c43da19ff112b6d715a9eb47cf02501181e8ef29 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 10 Jul 2017 19:10:04 -0700 Subject: [PATCH] Do not add the configuration for CacheTagHelperOptions to the container multiple times --- .../CacheTagHelperOptions.cs | 2 +- .../DependencyInjection/TagHelperExtensions.cs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperOptions.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperOptions.cs index 308a60273d..0e141b26ff 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperOptions.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperOptions.cs @@ -12,6 +12,6 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers /// The maximum total size in bytes that will be cached by the /// at any given time. /// - public long SizeLimit { get; set; } + public long SizeLimit { get; set; } = 100 * 1024 * 1024; // 100MB } } diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs index 20dd02be91..5161244492 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs @@ -14,8 +14,6 @@ namespace Microsoft.Extensions.DependencyInjection /// public static class TagHelperServicesExtensions { - private const int DefaultCacheMaximumSizeInBytes = 100 * 1024 * 1024; // 100MB - /// /// Adds MVC cache tag helper services to the application. /// @@ -35,7 +33,6 @@ namespace Microsoft.Extensions.DependencyInjection // Required default services for cache tag helpers builder.Services.AddDistributedMemoryCache(); builder.Services.TryAddSingleton(); - builder.AddCacheTagHelperLimits(options => options.SizeLimit = DefaultCacheMaximumSizeInBytes); return builder; }