@@ -53,7 +53,11 @@ public static class GrpcClientServiceExtensions
53
53
/// <typeparamref name="TClient"/> as the service type.
54
54
/// </para>
55
55
/// </remarks>
56
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services )
56
+ public static IHttpClientBuilder AddGrpcClient <
57
+ #if NET5_0_OR_GREATER
58
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
59
+ #endif
60
+ TClient > ( this IServiceCollection services )
57
61
where TClient : class
58
62
{
59
63
if ( services == null )
@@ -89,7 +93,11 @@ public static IHttpClientBuilder AddGrpcClient<TClient>(this IServiceCollection
89
93
/// <typeparamref name="TClient"/> as the service type.
90
94
/// </para>
91
95
/// </remarks>
92
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services , Action < GrpcClientFactoryOptions > configureClient )
96
+ public static IHttpClientBuilder AddGrpcClient <
97
+ #if NET5_0_OR_GREATER
98
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
99
+ #endif
100
+ TClient > ( this IServiceCollection services , Action < GrpcClientFactoryOptions > configureClient )
93
101
where TClient : class
94
102
{
95
103
var name = TypeNameHelper . GetTypeDisplayName ( typeof ( TClient ) , fullName : false ) ;
@@ -124,7 +132,11 @@ public static IHttpClientBuilder AddGrpcClient<TClient>(this IServiceCollection
124
132
/// a reference to a scoped service provider that shares the lifetime of the handler being constructed.
125
133
/// </para>
126
134
/// </remarks>
127
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services , Action < IServiceProvider , GrpcClientFactoryOptions > configureClient )
135
+ public static IHttpClientBuilder AddGrpcClient <
136
+ #if NET5_0_OR_GREATER
137
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
138
+ #endif
139
+ TClient > ( this IServiceCollection services , Action < IServiceProvider , GrpcClientFactoryOptions > configureClient )
128
140
where TClient : class
129
141
{
130
142
var name = TypeNameHelper . GetTypeDisplayName ( typeof ( TClient ) , fullName : false ) ;
@@ -154,7 +166,11 @@ public static IHttpClientBuilder AddGrpcClient<TClient>(this IServiceCollection
154
166
/// <typeparamref name="TClient"/> as the service type.
155
167
/// </para>
156
168
/// </remarks>
157
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services , string name )
169
+ public static IHttpClientBuilder AddGrpcClient <
170
+ #if NET5_0_OR_GREATER
171
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
172
+ #endif
173
+ TClient > ( this IServiceCollection services , string name )
158
174
where TClient : class
159
175
{
160
176
if ( services == null )
@@ -193,7 +209,11 @@ public static IHttpClientBuilder AddGrpcClient<TClient>(this IServiceCollection
193
209
/// <typeparamref name="TClient"/> as the service type.
194
210
/// </para>
195
211
/// </remarks>
196
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services , string name , Action < GrpcClientFactoryOptions > configureClient )
212
+ public static IHttpClientBuilder AddGrpcClient <
213
+ #if NET5_0_OR_GREATER
214
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
215
+ #endif
216
+ TClient > ( this IServiceCollection services , string name , Action < GrpcClientFactoryOptions > configureClient )
197
217
where TClient : class
198
218
{
199
219
if ( services == null )
@@ -243,7 +263,11 @@ public static IHttpClientBuilder AddGrpcClient<TClient>(this IServiceCollection
243
263
/// a reference to a scoped service provider that shares the lifetime of the handler being constructed.
244
264
/// </para>
245
265
/// </remarks>
246
- public static IHttpClientBuilder AddGrpcClient < TClient > ( this IServiceCollection services , string name , Action < IServiceProvider , GrpcClientFactoryOptions > configureClient )
266
+ public static IHttpClientBuilder AddGrpcClient <
267
+ #if NET5_0_OR_GREATER
268
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicConstructors ) ]
269
+ #endif
270
+ TClient > ( this IServiceCollection services , string name , Action < IServiceProvider , GrpcClientFactoryOptions > configureClient )
247
271
where TClient : class
248
272
{
249
273
if ( services == null )
0 commit comments