Просмотр исходного кода

Merge pull request #21928 from Kahbazi/patch-15

Remove Obsolete constructor in RequestLocalizationMiddleware
Ryan Brandenburg 5 лет назад
Родитель
Сommit
917078ddb7

+ 0 - 3
src/Middleware/Localization/ref/Microsoft.AspNetCore.Localization.netcoreapp.cs

@@ -100,9 +100,6 @@ namespace Microsoft.AspNetCore.Localization
     }
     public partial class RequestLocalizationMiddleware
     {
-        [System.ObsoleteAttribute("This constructor is obsolete and will be removed in a future version. Use RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options, ILoggerFactory loggerFactory) instead")]
-        public RequestLocalizationMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.RequestLocalizationOptions> options) { }
-        [Microsoft.Extensions.DependencyInjection.ActivatorUtilitiesConstructorAttribute]
         public RequestLocalizationMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Builder.RequestLocalizationOptions> options, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { }
         [System.Diagnostics.DebuggerStepThroughAttribute]
         public System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext context) { throw null; }

+ 0 - 13
src/Middleware/Localization/src/RequestLocalizationMiddleware.cs

@@ -36,7 +36,6 @@ namespace Microsoft.AspNetCore.Localization
         /// <param name="options">The <see cref="RequestLocalizationOptions"/> representing the options for the
         /// <param name="loggerFactory">The <see cref="ILoggerFactory"/> used for logging.</param>
         /// <see cref="RequestLocalizationMiddleware"/>.</param>
-        [ActivatorUtilitiesConstructor]
         public RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options, ILoggerFactory loggerFactory)
         {
             if (options == null)
@@ -49,18 +48,6 @@ namespace Microsoft.AspNetCore.Localization
             _options = options.Value;
         }
 
-        /// <summary>
-        /// Creates a new <see cref="RequestLocalizationMiddleware"/>.
-        /// </summary>
-        /// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param>
-        /// <param name="options">The <see cref="RequestLocalizationOptions"/> representing the options for the
-        /// <see cref="RequestLocalizationMiddleware"/>.</param>
-        [Obsolete("This constructor is obsolete and will be removed in a future version. Use RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options, ILoggerFactory loggerFactory) instead")]
-        public RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options)
-               : this(next, options, NullLoggerFactory.Instance)
-        {
-        }
-
         /// <summary>
         /// Invokes the logic of the middleware.
         /// </summary>