@@ -10,9 +10,8 @@ namespace Microsoft.Extensions.DependencyInjection;
10
10
using Microsoft . AspNetCore . Routing ;
11
11
using Microsoft . Extensions . DependencyInjection . Extensions ;
12
12
using Microsoft . Extensions . Options ;
13
- using System ;
14
13
using System . Diagnostics . CodeAnalysis ;
15
- using static Microsoft . Extensions . DependencyInjection . ServiceDescriptor ;
14
+ using static ServiceDescriptor ;
16
15
using static System . Diagnostics . CodeAnalysis . DynamicallyAccessedMemberTypes ;
17
16
18
17
/// <summary>
@@ -141,9 +140,9 @@ private static void AddApiVersioningServices( IServiceCollection services )
141
140
ArgumentNullException . ThrowIfNull ( services ) ;
142
141
143
142
services . TryAddSingleton < IApiVersionParser , ApiVersionParser > ( ) ;
144
- services . AddSingleton ( sp => sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionReader ) ;
145
- services . AddSingleton ( sp => ( IApiVersionParameterSource ) sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionReader ) ;
146
- services . AddSingleton ( sp => sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionSelector ) ;
143
+ services . AddSingleton ( static sp => sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionReader ) ;
144
+ services . AddSingleton ( static sp => ( IApiVersionParameterSource ) sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionReader ) ;
145
+ services . AddSingleton ( static sp => sp . GetRequiredService < IOptions < ApiVersioningOptions > > ( ) . Value . ApiVersionSelector ) ;
147
146
services . TryAddSingleton < IReportApiVersions , DefaultApiVersionReporter > ( ) ;
148
147
services . TryAddSingleton < ISunsetPolicyManager , SunsetPolicyManager > ( ) ;
149
148
services . TryAddEnumerable ( Transient < IValidateOptions < ApiVersioningOptions > , ValidateApiVersioningOptions > ( ) ) ;
0 commit comments