From 7d05e361b44b45e9fb194ecb43bbd6c4eda33551 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 27 Oct 2023 11:20:11 -0500 Subject: [PATCH] Fix trim warning in ResilienceHandlerContext Contributes to #4622 --- .../Resilience/ResilienceHandlerContext.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Libraries/Microsoft.Extensions.Http.Resilience/Resilience/ResilienceHandlerContext.cs b/src/Libraries/Microsoft.Extensions.Http.Resilience/Resilience/ResilienceHandlerContext.cs index a0e4e4ccdd1..6aac781d3ed 100644 --- a/src/Libraries/Microsoft.Extensions.Http.Resilience/Resilience/ResilienceHandlerContext.cs +++ b/src/Libraries/Microsoft.Extensions.Http.Resilience/Resilience/ResilienceHandlerContext.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.Http.Resilience.Internal; using Microsoft.Shared.Diagnostics; using Polly.DependencyInjection; @@ -47,7 +48,7 @@ internal ResilienceHandlerContext(AddResiliencePipelineContext context) /// You can listen for changes only for single options. If you call this method multiple times, the preceding calls are ignored and only the last one wins. /// /// - public void EnableReloads(string? name = null) => _context.EnableReloads(name); + public void EnableReloads<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TOptions>(string? name = null) => _context.EnableReloads(name); /// /// Gets the options identified by .