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 .