1 interface inheriting from IOptions
Microsoft.Extensions.Options (1)
IOptionsSnapshot.cs (1)
13IOptions<TOptions>
15 implementations of IOptions
Microsoft.AspNetCore.Antiforgery.Test (2)
DefaultAntiforgeryTest.cs (1)
1569private class TestOptionsManager : IOptions<AntiforgeryOptions>
TestOptionsManager.cs (1)
8public class TestOptionsManager : IOptions<AntiforgeryOptions>
Microsoft.AspNetCore.Identity.Test (1)
PasswordHasherTest.cs (1)
205private class PasswordHasherOptionsAccessor : IOptions<PasswordHasherOptions>
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelStateDictionaryTest.cs (1)
1761private class OptionsAccessor : IOptions<MvcOptions>
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\EmptyModelMetadataProvider.cs (1)
26private sealed class OptionsAccessor : IOptions<MvcOptions>
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
TestMvcOptions.cs (1)
15public class TestMvcOptions : IOptions<MvcOptions>
Microsoft.AspNetCore.ResponseCompression (2)
BrotliCompressionProviderOptions.cs (1)
12public class BrotliCompressionProviderOptions : IOptions<BrotliCompressionProviderOptions>
GzipCompressionProviderOptions.cs (1)
12public class GzipCompressionProviderOptions : IOptions<GzipCompressionProviderOptions>
Microsoft.Extensions.Caching.Memory (1)
MemoryCacheOptions.cs (1)
14public class MemoryCacheOptions : IOptions<MemoryCacheOptions>
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCacheOptions.cs (1)
13public class SqlServerCacheOptions : IOptions<SqlServerCacheOptions>
Microsoft.Extensions.Caching.SqlServer.Tests (1)
TestOptions.cs (1)
8internal class TestSqlServerCacheOptions : IOptions<SqlServerCacheOptions>
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCacheOptions.cs (1)
16public class RedisCacheOptions : IOptions<RedisCacheOptions>
Microsoft.Extensions.Options (3)
OptionsManager.cs (1)
14IOptions<TOptions>,
OptionsWrapper.cs (1)
13IOptions<TOptions>
UnnamedOptionsManager.cs (1)
10IOptions<TOptions>
1015 references to IOptions
Aspire.Dashboard (5)
DashboardWebApplication.cs (2)
296var corsOptions = _app.Services.GetRequiredService<IOptions<CorsOptions>>().Value; 688var options = context.HttpContext.RequestServices.GetRequiredService<IOptions<DashboardOptions>>().Value;
Otlp\Storage\TelemetryRepository.cs (1)
56public TelemetryRepository(ILoggerFactory loggerFactory, IOptions<DashboardOptions> dashboardOptions)
ResourceService\DashboardClient.cs (1)
74IOptions<DashboardOptions> dashboardOptions,
ResourceService\DashboardClientStatus.cs (1)
9internal sealed class DashboardClientStatus(IOptions<DashboardOptions> dashboardOptions) : IDashboardClientStatus
Aspire.Dashboard.Components.Tests (4)
Pages\ConsoleLogsTests.cs (1)
165Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Pages\StructuredLogsTests.cs (1)
178Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Pages\TraceDetailsTests.cs (1)
112Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Shared\MetricsSetupHelpers.cs (1)
77context.Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Aspire.Dashboard.Tests (5)
Integration\StartupTests.cs (4)
497var options = app.Services.GetRequiredService<IOptions<LoggerFilterOptions>>(); 536var options = app.Services.GetRequiredService<IOptions<LoggerFilterOptions>>();
Model\DashboardClientTests.cs (1)
22private readonly IOptions<DashboardOptions> _dashboardOptions;
Aspire.Hosting (13)
Codespaces\CodespacesResourceUrlRewriterService.cs (1)
12internal sealed class CodespacesResourceUrlRewriterService(ILogger<CodespacesResourceUrlRewriterService> logger, IOptions<CodespacesOptions> options, CodespacesUrlRewriter codespaceUrlRewriter, ResourceNotificationService resourceNotificationService) : BackgroundService
Codespaces\CodespacesUrlRewriter.cs (1)
8internal sealed class CodespacesUrlRewriter(IOptions<CodespacesOptions> options)
Dashboard\DashboardLifecycleHook.cs (1)
25IOptions<DashboardOptions> dashboardOptions,
Dashboard\DashboardOptions.cs (1)
21internal class ConfigureDefaultDashboardOptions(IConfiguration configuration, IOptions<DcpOptions> dcpOptions) : IConfigureOptions<DashboardOptions>
Dcp\ApplicationExecutor.cs (2)
76IOptions<DcpOptions> options, 102private readonly IOptions<DcpOptions> _options = options;
Dcp\DcpDependencyCheck.cs (1)
25public DcpDependencyCheck(IOptions<DcpOptions> dcpOptions)
Dcp\DcpHostService.cs (1)
44IOptions<DcpOptions> dcpOptions,
Dcp\DcpNameGenerator.cs (2)
20private readonly IOptions<DcpOptions> _options; 22public DcpNameGenerator(IConfiguration configuration, IOptions<DcpOptions> options)
Dcp\KubernetesService.cs (1)
55internal sealed class KubernetesService(ILogger<KubernetesService> logger, IOptions<DcpOptions> dcpOptions, Locations locations) : IKubernetesService, IDisposable
Publishing\ManifestPublisher.cs (2)
13IOptions<PublishingOptions> options, 18private readonly IOptions<PublishingOptions> _options = options;
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
30IOptions<AzureProvisionerOptions> options, 31IOptions<AzureProvisioningOptions> provisioningOptions,
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
24IOptions<AzureProvisioningOptions> provisioningOptions,
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
27public DaprDistributedApplicationLifecycleHook(IConfiguration configuration, IHostEnvironment environment, ILogger<DaprDistributedApplicationLifecycleHook> logger, IOptions<DaprOptions> options)
Aspire.Hosting.Tests (22)
Dashboard\DashboardLifecycleHookTests.cs (1)
104IOptions<CodespacesOptions>? codespacesOptions = null
Dcp\DcpCliArgsTests.cs (1)
55var dcpOptions = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value;
DistributedApplicationBuilderTests.cs (6)
47var options = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 70var publishOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>(); 83var publishOptions = app.Services.GetRequiredService<IOptions<PublishingOptions>>();
DistributedApplicationTests.cs (13)
281var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 318var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 363var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 416var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 455var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 488var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 517var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 546var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 576var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 660var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 679var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 818var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix; 852var suffix = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value.ResourceNameSuffix;
Helpers\JsonDocumentManifestPublisher.cs (1)
15IOptions<PublishingOptions> options,
Aspire.OpenAI (1)
AspireOpenAIExtensions.cs (1)
127var options = serviceProvider.GetRequiredService<IOptions<OpenAIClientOptions>>().Value;
Aspire.OpenAI.Tests (2)
AspireOpenAIExtensionsTests.cs (2)
174var options = host.Services.GetRequiredService<IOptions<OpenAIClientOptions>>().Value; 194var options = host.Services.GetRequiredService<IOptions<OpenAIClientOptions>>().Value;
Aspire.StackExchange.Redis (1)
AspireRedisExtensions.cs (1)
156serviceProvider.GetRequiredService<IOptions<ConfigurationOptions>>().Value :
Aspire.StackExchange.Redis.Tests (1)
AspireRedisExtensionsTests.cs (1)
195host.Services.GetRequiredService<IOptions<ConfigurationOptions>>().Value;
BasicWebSite (3)
Controllers\ContentNegotiation\FallbackOnTypeBasedMatchController.cs (3)
13private readonly IOptions<MvcOptions> _mvcOptions; 16public FallbackOnTypeBasedMatchController(IOptions<MvcOptions> mvcOptions) 73[FromServices] IOptions<MvcOptions> optionsAccessor)
CreateDefaultBuilderOfTApp (2)
Program.cs (2)
37var hostFilteringOptions = app.ApplicationServices.GetRequiredService<IOptions<HostFilteringOptions>>();
CustomPolicyProvider (1)
Authorization\MinimumAgePolicyProvider.cs (1)
16public MinimumAgePolicyProvider(IOptions<AuthorizationOptions> options)
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
IIS.LongTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
KeyManagementSimulator (1)
Program.cs (1)
347var keyManagementOptions = Options.Create(new KeyManagementOptions()
Microsoft.AspNetCore.Antiforgery (3)
Internal\AntiforgeryOptionsSetup.cs (1)
16public AntiforgeryOptionsSetup(IOptions<DataProtectionOptions> dataProtectionOptions)
Internal\DefaultAntiforgery.cs (1)
26IOptions<AntiforgeryOptions> antiforgeryOptionsAccessor,
Internal\DefaultAntiforgeryTokenStore.cs (1)
15public DefaultAntiforgeryTokenStore(IOptions<AntiforgeryOptions> optionsAccessor)
Microsoft.AspNetCore.Antiforgery.Test (4)
AntiforgeryOptionsSetupTest.cs (4)
28var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 53var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>();
Microsoft.AspNetCore.Authentication (1)
AuthenticationBuilder.cs (1)
117public EnsureSignInScheme(IOptions<AuthenticationOptions> authOptions)
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenHandler.cs (1)
86var typeInfo = httpContext.RequestServices.GetService<IOptions<JsonOptions>>()
Microsoft.AspNetCore.Authentication.Certificate (2)
CertificateValidationCache.cs (2)
21internal CertificateValidationCache(IOptions<CertificateValidationCacheOptions> options, TimeProvider timeProvider) 32public CertificateValidationCache(IOptions<CertificateValidationCacheOptions> options) : this(options, TimeProvider.System)
Microsoft.AspNetCore.Authentication.Core (3)
AuthenticationSchemeProvider.cs (2)
20public AuthenticationSchemeProvider(IOptions<AuthenticationOptions> options) 31protected AuthenticationSchemeProvider(IOptions<AuthenticationOptions> options, IDictionary<string, AuthenticationScheme> schemes)
AuthenticationService.cs (1)
25public AuthenticationService(IAuthenticationSchemeProvider schemes, IAuthenticationHandlerProvider handlers, IClaimsTransformation transform, IOptions<AuthenticationOptions> options)
Microsoft.AspNetCore.Authentication.Core.Test (1)
AuthenticationSchemeProviderTests.cs (1)
302public IgnoreCaseSchemeProvider(IOptions<AuthenticationOptions> options)
Microsoft.AspNetCore.Authentication.Negotiate.Test (2)
ServerDeferralTests.cs (2)
20var options = host.Services.GetRequiredService<IOptions<NegotiateOptions>>().Value; 37var options = host.Services.GetRequiredService<IOptions<NegotiateOptions>>().Value;
Microsoft.AspNetCore.Authorization (3)
DefaultAuthorizationPolicyProvider.cs (1)
25public DefaultAuthorizationPolicyProvider(IOptions<AuthorizationOptions> options)
DefaultAuthorizationService.cs (1)
35public DefaultAuthorizationService(IAuthorizationPolicyProvider policyProvider, IAuthorizationHandlerProvider handlers, ILogger<DefaultAuthorizationService> logger, IAuthorizationHandlerContextFactory contextFactory, IAuthorizationEvaluator evaluator, IOptions<AuthorizationOptions> options)
PassThroughAuthorizationHandler.cs (1)
28public PassThroughAuthorizationHandler(IOptions<AuthorizationOptions> options)
Microsoft.AspNetCore.Authorization.Test (7)
AuthorizationBuilderTests.cs (6)
21var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 37var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 52var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 68var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 83var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 97var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value;
AuthorizationMiddlewareTests.cs (1)
330public TestDefaultPolicyProvider(IOptions<AuthorizationOptions> options, bool canCache) : base(options)
Microsoft.AspNetCore.Components (2)
Routing\RouteTableFactory.cs (1)
118var routeOptions = Options.Create(new RouteOptions());
src\Http\Routing\src\DefaultInlineConstraintResolver.cs (1)
31public DefaultInlineConstraintResolver(IOptions<RouteOptions> routeOptions, IServiceProvider serviceProvider)
Microsoft.AspNetCore.Components.Endpoints (6)
Builder\OpaqueRedirection.cs (2)
45var options = httpContext.RequestServices.GetRequiredService<IOptions<RazorComponentsServiceOptions>>();
FormMapping\HttpContextFormValueMapper.cs (1)
25IOptions<RazorComponentsServiceOptions> options)
Rendering\EndpointHtmlRenderer.cs (1)
56_options = serviceProvider.GetRequiredService<IOptions<RazorComponentsServiceOptions>>().Value;
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
207var options = httpContext.RequestServices.GetRequiredService<IOptions<RazorComponentsServiceOptions>>();
Microsoft.AspNetCore.Components.Server (6)
CircuitJavaScriptInitializationMiddleware.cs (1)
16public CircuitJavaScriptInitializationMiddleware(IOptions<CircuitOptions> options, RequestDelegate _)
Circuits\CircuitFactory.cs (1)
28IOptions<CircuitOptions> options)
Circuits\CircuitRegistry.cs (1)
47IOptions<CircuitOptions> options,
Circuits\RemoteErrorBoundaryLogger.cs (1)
17public RemoteErrorBoundaryLogger(ILogger<ErrorBoundary> logger, IJSRuntime jsRuntime, IOptions<CircuitOptions> options)
Circuits\RemoteJSRuntime.cs (2)
41IOptions<CircuitOptions> circuitOptions, 42IOptions<HubOptions<ComponentHub>> componentHubOptions,
Microsoft.AspNetCore.Components.Server.Tests (14)
Circuits\ComponentHubTest.cs (1)
194IOptions<CircuitOptions> options)
Circuits\RemoteJSDataStreamTest.cs (2)
357public TestRemoteJSRuntime(IOptions<CircuitOptions> circuitOptions, IOptions<HubOptions<ComponentHub>> hubOptions, ILogger<RemoteJSRuntime> logger) : base(circuitOptions, hubOptions, logger)
Circuits\RemoteJSRuntimeTest.cs (3)
102var componentHubOptions = Options.Create(new HubOptions<ComponentHub>()); 110public TestRemoteJSRuntime(IOptions<CircuitOptions> circuitOptions, IOptions<HubOptions<ComponentHub>> hubOptions, ILogger<RemoteJSRuntime> logger) : base(circuitOptions, hubOptions, logger)
DependencyInjection\ComponentServiceCollectionExtensionsTest.cs (8)
21var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 42var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 68var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 69var globalOptions = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions>>();
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
AuthenticationStateSerializer.cs (1)
21public AuthenticationStateSerializer(PersistentComponentState persistentComponentState, IOptions<AuthenticationStateSerializationOptions> options)
Microsoft.AspNetCore.ConcurrencyLimiter (4)
ConcurrencyLimiterMiddleware.cs (1)
28public ConcurrencyLimiterMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IQueuePolicy queue, IOptions<ConcurrencyLimiterOptions> options)
QueuePolicies\BasePolicy.cs (1)
19public BasePolicy(IOptions<QueuePolicyOptions> options, QueueProcessingOrder order)
QueuePolicies\QueuePolicy.cs (1)
11public QueuePolicy(IOptions<QueuePolicyOptions> options)
QueuePolicies\StackPolicy.cs (1)
11public StackPolicy(IOptions<QueuePolicyOptions> options)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (3)
TestUtils.cs (3)
15var options = Options.Create(new ConcurrencyLimiterOptions 48var options = Options.Create(new QueuePolicyOptions 59var options = Options.Create(new QueuePolicyOptions
Microsoft.AspNetCore.CookiePolicy (2)
CookiePolicyMiddleware.cs (2)
35public CookiePolicyMiddleware(RequestDelegate next, IOptions<CookiePolicyOptions> options, ILoggerFactory factory) 47public CookiePolicyMiddleware(RequestDelegate next, IOptions<CookiePolicyOptions> options)
Microsoft.AspNetCore.Cors (2)
Infrastructure\CorsService.cs (1)
27public CorsService(IOptions<CorsOptions> options, ILoggerFactory loggerFactory)
Infrastructure\DefaultCorsPolicyProvider.cs (1)
19public DefaultCorsPolicyProvider(IOptions<CorsOptions> options)
Microsoft.AspNetCore.Cors.Test (2)
DefaultCorsPolicyProviderTests.cs (2)
19var corsOptions = Options.Create(options); 39var corsOptions = Options.Create(options);
Microsoft.AspNetCore.DataProtection (13)
DataProtectionServiceCollectionExtensions.cs (2)
85var dpOptions = s.GetRequiredService<IOptions<DataProtectionOptions>>();
KeyManagement\DefaultKeyResolver.cs (2)
56public DefaultKeyResolver(IOptions<KeyManagementOptions> keyManagementOptions) 60public DefaultKeyResolver(IOptions<KeyManagementOptions> keyManagementOptions, ILoggerFactory loggerFactory)
KeyManagement\KeyRingProvider.cs (2)
34IOptions<KeyManagementOptions> keyManagementOptions, 46IOptions<KeyManagementOptions> keyManagementOptions,
KeyManagement\XmlKeyManager.cs (6)
68/// <param name="keyManagementOptions">The <see cref="IOptions{KeyManagementOptions}"/> instance that provides the configuration.</param> 71public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions, IActivator activator) 79/// <param name="keyManagementOptions">The <see cref="IOptions{KeyManagementOptions}"/> instance that provides the configuration.</param> 83public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions, IActivator activator, ILoggerFactory loggerFactory) 89IOptions<KeyManagementOptions> keyManagementOptions, 127IOptions<KeyManagementOptions> keyManagementOptions,
XmlEncryption\EncryptedXmlDecryptor.cs (1)
40_options = services?.GetService<IOptions<XmlKeyDecryptionOptions>>()?.Value;
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
DataProtectionProviderTests.cs (1)
63s.GetRequiredService<IOptions<KeyManagementOptions>>(),
Microsoft.AspNetCore.DataProtection.Tests (16)
KeyManagement\DefaultKeyResolverTests.cs (2)
318var options = Options.Create(new KeyManagementOptions() 395var options = Options.Create(new KeyManagementOptions()
KeyManagement\XmlKeyManagerTests.cs (11)
34var options = Options.Create(new KeyManagementOptions() 58var options = Options.Create(new KeyManagementOptions() 101var options = Options.Create(new KeyManagementOptions() 199var options = Options.Create(new KeyManagementOptions() 305var options = Options.Create(new KeyManagementOptions() 600var options = Options.Create(new KeyManagementOptions() 627var options = Options.Create(new KeyManagementOptions() 677var options = Options.Create(new KeyManagementOptions() 732var options = Options.Create(new KeyManagementOptions() 798var keyManagementOptions = Options.Create(new KeyManagementOptions() 899var keyManagementOptions = Options.Create(new KeyManagementOptions()
ServiceCollectionTests.cs (3)
26Assert.NotNull(services.GetService<IOptions<DataProtectionOptions>>()); 88var options = services.GetRequiredService<IOptions<KeyManagementOptions>>().Value; 121var options = services.GetRequiredService<IOptions<KeyManagementOptions>>().Value;
Microsoft.AspNetCore.Diagnostics (10)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
31IOptions<DeveloperExceptionPageOptions> options,
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
47IOptions<DeveloperExceptionPageOptions> options, 53IOptions<JsonOptions>? jsonOptions = null,
ExceptionHandler\ExceptionHandlerExtensions.cs (3)
103var iOptions = Options.Create(options); 107private static IApplicationBuilder SetExceptionHandlerMiddleware(IApplicationBuilder app, IOptions<ExceptionHandlerOptions>? options) 125options = app.ApplicationServices.GetRequiredService<IOptions<ExceptionHandlerOptions>>();
ExceptionHandler\ExceptionHandlerMiddleware.cs (1)
30IOptions<ExceptionHandlerOptions> options,
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
36IOptions<ExceptionHandlerOptions> options,
StatusCodePage\StatusCodePagesMiddleware.cs (1)
24public StatusCodePagesMiddleware(RequestDelegate next, IOptions<StatusCodePagesOptions> options)
WelcomePage\WelcomePageMiddleware.cs (1)
24public WelcomePageMiddleware(RequestDelegate next, IOptions<WelcomePageOptions> options)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (4)
DatabaseDeveloperPageExceptionFilter.cs (2)
34/// <param name="options">The <see cref="IOptions{DatabaseErrorPageOptions}"/>.</param> 35public DatabaseDeveloperPageExceptionFilter(ILogger<DatabaseDeveloperPageExceptionFilter> logger, IOptions<DatabaseErrorPageOptions> options)
DatabaseErrorPageMiddleware.cs (1)
55IOptions<DatabaseErrorPageOptions> options)
MigrationsEndPointMiddleware.cs (1)
34IOptions<MigrationsEndPointOptions> options)
Microsoft.AspNetCore.Diagnostics.HealthChecks (4)
Builder\HealthCheckApplicationBuilderExtensions.cs (3)
31/// The health check middleware will use default settings from <see cref="IOptions{HealthCheckOptions}"/>. 82/// The health check middleware will use default settings from <see cref="IOptions{HealthCheckOptions}"/>. 109/// The health check middleware will use default settings from <see cref="IOptions{HealthCheckOptions}"/>.
HealthCheckMiddleware.cs (1)
24IOptions<HealthCheckOptions> healthCheckOptions,
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Latency\RequestLatencyTelemetryMiddleware.cs (2)
37IOptions<RequestLatencyTelemetryOptions> options, 39IOptions<ApplicationMetadata>? appMetdata = null)
Logging\HttpLoggingRedactionInterceptor.cs (1)
38IOptions<LoggingRedactionOptions> options,
Logging\RequestHeadersLogEnricher.cs (1)
32public RequestHeadersLogEnricher(IHttpContextAccessor httpContextAccessor, IOptions<RequestHeadersLogEnricherOptions> options,
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (7)
Latency\RequestLatencyTelemetryExtensionsTests.cs (2)
62var actualOptions = serviceProvider.GetRequiredService<IOptions<RequestLatencyTelemetryOptions>>();
Logging\HttpLoggingServiceExtensionsTests.cs (2)
46var options = provider.GetRequiredService<IOptions<LoggingRedactionOptions>>().Value; 78var options = provider.GetRequiredService<IOptions<LoggingRedactionOptions>>().Value;
Logging\RequestHeadersEnricherExtensionsTests.cs (1)
65var options = serviceProvider.GetRequiredService<IOptions<RequestHeadersLogEnricherOptions>>().Value;
Logging\TestExtensions.cs (2)
11public static IOptions<RequestHeadersLogEnricherOptions> ToOptions(this RequestHeadersLogEnricherOptions options) 13var mock = new Mock<IOptions<RequestHeadersLogEnricherOptions>>();
Microsoft.AspNetCore.Diagnostics.Tests (14)
ExceptionHandlerMiddlewareTest.cs (14)
88var optionsAccessor = CreateOptionsAccessor( 110var optionsAccessor = CreateOptionsAccessor( 131var optionsAccessor = CreateOptionsAccessor(); 156var optionsAccessor = CreateOptionsAccessor(); 181var optionsAccessor = CreateOptionsAccessor( 211var optionsAccessor = CreateOptionsAccessor(); 234var optionsAccessor = CreateOptionsAccessor(); 256var optionsAccessor = CreateOptionsAccessor(); 282var optionsAccessor = CreateOptionsAccessor(); 429var optionsAccessor = CreateOptionsAccessor(exceptionHandler: c => 491private IOptions<ExceptionHandlerOptions> CreateOptionsAccessor( 501var optionsAccessor = Mock.Of<IOptions<ExceptionHandlerOptions>>(o => o.Value == options); 507IOptions<ExceptionHandlerOptions> options,
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\Binding\JsonTranscodingServiceMethodProvider.cs (3)
26IOptions<GrpcServiceOptions> globalOptions, 27IOptions<GrpcServiceOptions<TService>> serviceOptions, 29IOptions<GrpcJsonTranscodingOptions> jsonTranscodingOptions,
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
GrpcJsonTranscodingServiceExtensionsTests.cs (3)
22var options1 = serviceProvider.GetRequiredService<IOptions<GrpcJsonTranscodingOptions>>().Value; 26var options2 = serviceProvider.GetRequiredService<IOptions<GrpcJsonTranscodingOptions>>().Value; 47var options = serviceProvider.GetRequiredService<IOptions<GrpcJsonTranscodingOptions>>().Value;
Microsoft.AspNetCore.Grpc.Swagger (1)
GrpcSwaggerServiceExtensions.cs (1)
50var serializerOptions = s.GetService<IOptions<JsonOptions>>()?.Value?.JsonSerializerOptions ?? new JsonSerializerOptions();
Microsoft.AspNetCore.HeaderParsing (1)
HeaderRegistry.cs (1)
21public HeaderRegistry(IServiceProvider provider, IOptions<HeaderParsingOptions> options)
Microsoft.AspNetCore.HeaderParsing.Tests (6)
HeaderParsingExtensionsTests.cs (4)
25var options = services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value; 37Assert.Throws<OptionsValidationException>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value); 47Assert.Throws<OptionsValidationException>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value); 57var options = services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value;
HeaderParsingFeatureTests.cs (1)
23private readonly IOptions<HeaderParsingOptions> _options;
HeaderRegistryTests.cs (1)
15private readonly IOptions<HeaderParsingOptions> _options;
Microsoft.AspNetCore.HeaderPropagation (4)
DependencyInjection\HeaderPropagationHttpClientBuilderExtensions.cs (2)
31var middlewareOptions = services.GetRequiredService<IOptions<HeaderPropagationOptions>>();
HeaderPropagationMiddleware.cs (2)
24/// <param name="options">The <see cref="IOptions{HeaderPropagationOptions}"/>.</param> 28public HeaderPropagationMiddleware(RequestDelegate next, IOptions<HeaderPropagationOptions> options, HeaderPropagationValues values)
Microsoft.AspNetCore.Hosting (2)
GenericHost\GenericWebHostService.cs (1)
19public GenericWebHostService(IOptions<GenericWebHostServiceOptions> options,
Http\DefaultHttpContextFactory.cs (1)
33_formOptions = serviceProvider.GetRequiredService<IOptions<FormOptions>>().Value;
Microsoft.AspNetCore.Hosting.Tests (3)
StartupManagerTests.cs (2)
353var options = app.ApplicationServices.GetRequiredService<IOptions<FakeOptions>>().Value; 400var options = app.ApplicationServices.GetRequiredService<IOptions<FakeOptions>>().Value;
WebHostTests.cs (1)
742Assert.NotNull(host.Services.GetRequiredService<IOptions<object>>());
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionManager.cs (1)
30public HttpConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifetime appLifetime, IOptions<ConnectionOptions> connectionOptions, HttpConnectionsMetrics metrics)
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnectionFactory.cs (1)
28public HttpConnectionFactory(IOptions<HttpConnectionOptions> options, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.Http.Extensions (5)
DefaultProblemDetailsWriter.cs (2)
20public DefaultProblemDetailsWriter(IOptions<ProblemDetailsOptions> options, IOptions<JsonOptions> jsonOptions)
HttpRequestJsonExtensions.cs (1)
306return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
HttpResponseJsonExtensions.cs (1)
345return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
RequestDelegateFactory.cs (1)
276var jsonSerializerOptions = serviceProvider.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
Microsoft.AspNetCore.Http.Extensions.Tests (15)
ProblemDetailsServiceCollectionExtensionsTest.cs (12)
98var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 123var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 163var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 184var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 204var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 229var jsonOptions = services.GetService<IOptions<JsonOptions>>();
RequestDelegateFactoryTests.cs (1)
864if (t == typeof(IOptions<JsonOptions>))
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (2)
225if (t == typeof(IOptions<JsonOptions>)) 281if (t == typeof(IOptions<JsonOptions>))
Microsoft.AspNetCore.Http.Results (1)
HttpResultsHelper.cs (1)
153return httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
Microsoft.AspNetCore.HttpOverrides (3)
CertificateForwardingMiddleware.cs (1)
30IOptions<CertificateForwardingOptions> options)
ForwardedHeadersMiddleware.cs (1)
46public ForwardedHeadersMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IOptions<ForwardedHeadersOptions> options)
HttpMethodOverrideMiddleware.cs (1)
24public HttpMethodOverrideMiddleware(RequestDelegate next, IOptions<HttpMethodOverrideOptions> options)
Microsoft.AspNetCore.HttpOverrides.Tests (4)
CertificateForwardingTest.cs (4)
23var options = services.BuildServiceProvider().GetRequiredService<IOptions<CertificateForwardingOptions>>(); 33var options = services.BuildServiceProvider().GetRequiredService<IOptions<CertificateForwardingOptions>>();
Microsoft.AspNetCore.HttpsPolicy (4)
HstsMiddleware.cs (2)
33public HstsMiddleware(RequestDelegate next, IOptions<HstsOptions> options, ILoggerFactory loggerFactory) 54public HstsMiddleware(RequestDelegate next, IOptions<HstsOptions> options)
HttpsRedirectionMiddleware.cs (2)
36public HttpsRedirectionMiddleware(RequestDelegate next, IOptions<HttpsRedirectionOptions> options, IConfiguration config, ILoggerFactory loggerFactory) 66public HttpsRedirectionMiddleware(RequestDelegate next, IOptions<HttpsRedirectionOptions> options, IConfiguration config, ILoggerFactory loggerFactory,
Microsoft.AspNetCore.Identity (7)
AspNetUserManager.cs (1)
32IOptions<IdentityOptions> optionsAccessor,
DataProtectorTokenProvider.cs (1)
25IOptions<DataProtectionTokenProviderOptions> options,
SecurityStampValidator.cs (2)
27public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ISystemClock clock, ILoggerFactory logger) 44public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ILoggerFactory logger)
SignInManager.cs (1)
43IOptions<IdentityOptions> optionsAccessor,
TwoFactorSecurityStampValidator.cs (2)
26public TwoFactorSecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ISystemClock clock, ILoggerFactory logger) : base(options, signInManager, clock, logger) 35public TwoFactorSecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, SignInManager<TUser> signInManager, ILoggerFactory logger) : base(options, signInManager, logger)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
IdentityUserContext.cs (1)
106?.GetService<IOptions<IdentityOptions>>()
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
36var options = new Mock<IOptions<IdentityOptions>>();
Microsoft.AspNetCore.Identity.InMemory.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
36var options = new Mock<IOptions<IdentityOptions>>();
Microsoft.AspNetCore.Identity.Test (31)
IdentityBuilderTest.cs (4)
215Assert.NotNull(provider.GetService<IOptions<SecurityStampValidatorOptions>>()); 235Assert.NotNull(provider.GetService<IOptions<SecurityStampValidatorOptions>>()); 246var tokenProviders = provider.GetRequiredService<IOptions<IdentityOptions>>().Value.Tokens.ProviderMap.Values; 406public MyClaimsPrincipalFactory(UserManager<PocoUser> userManager, RoleManager<PocoRole> roleManager, IOptions<IdentityOptions> optionsAccessor) : base(userManager, roleManager, optionsAccessor)
IdentityOptionsTest.cs (4)
46var optionsGetter = serviceProvider.GetRequiredService<IOptions<IdentityOptions>>(); 64var optionsGetter = serviceProvider.GetRequiredService<IOptions<IdentityOptions>>();
PasswordHasherTest.cs (1)
175private static IOptions<PasswordHasherOptions> BuildOptions(PasswordHasherCompatibilityMode? compatMode, int? iterCount)
SecurityStampValidatorTest.cs (12)
99var identityOptions = new Mock<IOptions<IdentityOptions>>(); 101var options = new Mock<IOptions<SecurityStampValidatorOptions>>(); 162var identityOptions = new Mock<IOptions<IdentityOptions>>(); 164var options = new Mock<IOptions<SecurityStampValidatorOptions>>(); 202var identityOptions = new Mock<IOptions<IdentityOptions>>(); 205var options = new Mock<IOptions<SecurityStampValidatorOptions>>(); 241var identityOptions = new Mock<IOptions<IdentityOptions>>(); 244var options = new Mock<IOptions<SecurityStampValidatorOptions>>(); 278var identityOptions = new Mock<IOptions<IdentityOptions>>(); 281var options = new Mock<IOptions<SecurityStampValidatorOptions>>(); 327var identityOptions = new Mock<IOptions<IdentityOptions>>(); 329var options = new Mock<IOptions<SecurityStampValidatorOptions>>();
SignInManagerTest.cs (7)
44var options = new Mock<IOptions<IdentityOptions>>(); 74var options = new Mock<IOptions<IdentityOptions>>(); 106var options = new Mock<IOptions<IdentityOptions>>(); 1284var options = Options.Create(new IdentityOptions()); 1303IOptions<IdentityOptions> optionsAccessor) 1315IOptions<IdentityOptions> optionsAccessor) 1332IOptions<IdentityOptions> optionsAccessor)
src\Identity\test\Shared\MockHelpers.cs (1)
36var options = new Mock<IOptions<IdentityOptions>>();
UserClaimsPrincipalFactoryTest.cs (2)
17var options = new Mock<IOptions<IdentityOptions>>(); 80var options = new Mock<IOptions<IdentityOptions>>();
Microsoft.AspNetCore.Localization (1)
RequestLocalizationMiddleware.cs (1)
33public RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
45IOptions<MvcOptions> optionsAccessor, 49IOptions<RouteOptions> routeOptions)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (1)
2238var optionsAccessor = Options.Create(options);
EndpointMetadataApiDescriptionProviderTest.cs (1)
1696if (serviceType == typeof(IOptions<RouteHandlerOptions>))
Microsoft.AspNetCore.Mvc.Core (42)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
17IOptions<ApiBehaviorOptions> apiBehaviorOptions,
ApplicationModels\ApplicationModelFactory.cs (1)
24IOptions<MvcOptions> options)
ApplicationModels\AuthorizationApplicationModelProvider.cs (1)
18IOptions<MvcOptions> mvcOptions)
ApplicationModels\DefaultApplicationModelProvider.cs (1)
28IOptions<MvcOptions> mvcOptionsAccessor,
Builder\MvcApplicationBuilderExtensions.cs (2)
68var options = app.ApplicationServices.GetRequiredService<IOptions<MvcOptions>>();
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (2)
211var options = s.GetRequiredService<IOptions<MvcOptions>>().Value; 217var options = s.GetRequiredService<IOptions<MvcOptions>>().Value;
Formatters\FormatFilter.cs (2)
25/// <param name="options">The <see cref="IOptions{MvcOptions}"/></param> 27public FormatFilter(IOptions<MvcOptions> options, ILoggerFactory loggerFactory)
Infrastructure\CompatibilitySwitch.cs (1)
50/// implementation of <see cref="ICompatibilitySwitch"/> suitable for use with the <see cref="IOptions{T}"/>
Infrastructure\ConfigureCompatibilityOptions.cs (2)
27/// <param name="compatibilityOptions">The <see cref="IOptions{MvcCompatibilityOptions}"/>.</param> 30IOptions<MvcCompatibilityOptions> compatibilityOptions)
Infrastructure\ControllerActionInvokerCache.cs (1)
30IOptions<MvcOptions> mvcOptions)
Infrastructure\ControllerActionInvokerProvider.cs (2)
30IOptions<MvcOptions> optionsAccessor, 40IOptions<MvcOptions> optionsAccessor,
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
27IOptions<ApiBehaviorOptions> apiBehaviorOptions)
Infrastructure\DefaultOutputFormatterSelector.cs (1)
37public DefaultOutputFormatterSelector(IOptions<MvcOptions> options, ILoggerFactory loggerFactory)
Infrastructure\DefaultProblemDetailsFactory.cs (2)
29IOptions<ApiBehaviorOptions> options, 30IOptions<ProblemDetailsOptions>? problemDetailsOptions = null)
Infrastructure\ModelStateInvalidFilterFactory.cs (2)
21var options = serviceProvider.GetRequiredService<IOptions<ApiBehaviorOptions>>();
Infrastructure\MvcCoreMvcOptionsSetup.cs (2)
27private readonly IOptions<JsonOptions> _jsonOptions; 34public MvcCoreMvcOptionsSetup(IHttpRequestStreamReaderFactory readerFactory, ILoggerFactory loggerFactory, IOptions<JsonOptions> jsonOptions)
Infrastructure\ObjectResultExecutor.cs (1)
31IOptions<MvcOptions> mvcOptions)
Infrastructure\SystemTextJsonResultExecutor.cs (1)
27IOptions<JsonOptions> options,
ModelBinding\Binders\ArrayModelBinderProvider.cs (1)
29var mvcOptions = context.Services.GetRequiredService<IOptions<MvcOptions>>().Value;
ModelBinding\Binders\CollectionModelBinderProvider.cs (1)
61var mvcOptions = context.Services.GetRequiredService<IOptions<MvcOptions>>().Value;
ModelBinding\Binders\DictionaryModelBinderProvider.cs (1)
36var mvcOptions = context.Services.GetRequiredService<IOptions<MvcOptions>>().Value;
ModelBinding\DefaultModelBindingContext.cs (2)
235var mvcOptions = actionContext.HttpContext.RequestServices?.GetService<IOptions<MvcOptions>>();
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (2)
40IOptions<MvcOptions> optionsAccessor) 143private static DefaultModelBindingMessageProvider GetMessageProvider(IOptions<MvcOptions> optionsAccessor)
ModelBinding\ModelBinderFactory.cs (2)
33/// <param name="options">The <see cref="IOptions{TOptions}"/> for <see cref="MvcOptions"/>.</param> 37IOptions<MvcOptions> options,
ModelBinding\ParameterBinder.cs (1)
34IOptions<MvcOptions> mvcOptions,
RequireHttpsAttribute.cs (2)
72var optionsAccessor = filterContext.HttpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>();
ResponseCacheAttribute.cs (2)
123var optionsAccessor = serviceProvider.GetRequiredService<IOptions<MvcOptions>>();
Routing\ControllerRequestDelegateFactory.cs (2)
32IOptions<MvcOptions> optionsAccessor, 42IOptions<MvcOptions> optionsAccessor,
Microsoft.AspNetCore.Mvc.Core.Test (58)
AcceptedAtActionResultTests.cs (1)
268var options = Options.Create(new MvcOptions());
AcceptedAtRouteResultTests.cs (1)
176var options = Options.Create(new MvcOptions());
AcceptedResultTests.cs (1)
133var options = Options.Create(new MvcOptions());
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (1)
216var optionsAccessor = Options.Create(options);
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (3)
16private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false }); 76var options = Options.Create(new AuthorizationOptions()); 130var authOptions = Options.Create(new AuthorizationOptions());
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
61var mvcOptions = Options.Create(new MvcOptions());
ApplicationModels\ControllerActionDescriptorProviderTests.cs (5)
696var options = Options.Create(new MvcOptions()); 1150var options = Options.Create(new MvcOptions()); 1328var options = Options.Create(new MvcOptions()); 1351var options = Options.Create(new MvcOptions()); 1367var options = Options.Create(new MvcOptions());
ApplicationModels\EndpointMetadataProviderTest.cs (1)
242var options = Options.Create(new MvcOptions());
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
913var mvcOptions = Options.Create(new MvcOptions());
Controllers\ControllerBinderDelegateProviderTest.cs (1)
26private static readonly IOptions<MvcOptions> _optionsAccessor = Options.Create(_options);
CreatedAtActionResultTests.cs (1)
86var options = Options.Create(new MvcOptions());
CreatedAtRouteResultTests.cs (1)
100var options = Options.Create(new MvcOptions());
CreatedResultTests.cs (1)
133var options = Options.Create(new MvcOptions());
DependencyInjection\MvcBuilderExtensionsTest.cs (1)
155.GetRequiredService<IOptions<ApiBehaviorOptions>>()
DependencyInjection\MvcCoreBuilderExtensionsTest.cs (1)
98.GetRequiredService<IOptions<ApiBehaviorOptions>>()
Filters\MiddlewareFilterTest.cs (1)
265var optionsAccessor = new Mock<IOptions<MvcOptions>>();
Formatters\FormatFilterTest.cs (1)
396public IOptions<MvcOptions> OptionsManager { get; private set; }
HttpNotFoundObjectResultTest.cs (1)
66var options = Options.Create(new MvcOptions());
HttpOkObjectResultTest.cs (1)
68var options = Options.Create(new MvcOptions());
Infrastructure\ActionSelectorTest.cs (1)
1002var options = Options.Create(new MvcOptions());
Infrastructure\ConfigureCompatibilityOptionsTest.cs (2)
77var compatibilityOptions = Options.Create(new MvcCompatibilityOptions() { CompatibilityVersion = version }); 111IOptions<MvcCompatibilityOptions> compatibilityOptions,
Infrastructure\ControllerActionInvokerCacheTest.cs (1)
96var mvcOptions = Options.Create(new MvcOptions());
Infrastructure\ControllerActionInvokerTest.cs (2)
1705var options = Options.Create(new MvcOptions()); 1709services.AddSingleton<IOptions<MvcOptions>>(options);
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
229var mvcOptions = Options.Create(new MvcOptions());
Infrastructure\ObjectResultExecutorTest.cs (1)
480var optionsAccessor = Options.Create(options);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
1086var options = Options.Create(new MvcOptions());
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1248var options = Options.Create(new MvcOptions());
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (1)
181var options = context.Services.GetRequiredService<IOptions<MvcOptions>>().Value;
ModelBinding\ModelBinderFactoryTest.cs (13)
23var options = Options.Create(new MvcOptions()); 43var options = Options.Create(new MvcOptions()); 69var options = Options.Create(new MvcOptions()); 109var options = Options.Create(new MvcOptions()); 144var options = Options.Create(new MvcOptions()); 185var options = Options.Create(new MvcOptions()); 223var options = Options.Create(new MvcOptions()); 254var options = Options.Create(new MvcOptions()); 369var options = Options.Create(new MvcOptions()); 395var options = Options.Create(new MvcOptions()); 456var options = Options.Create(new MvcOptions()); 520var options = Options.Create(new MvcOptions()); 582var options = Options.Create(new MvcOptions());
ModelBinding\ParameterBinderTest.cs (2)
26private static readonly IOptions<MvcOptions> _optionsAccessor = Options.Create(new MvcOptions()); 743IOptions<MvcOptions> optionsAccessor = null,
ObjectResultTests.cs (1)
159var options = Options.Create(new MvcOptions());
RequireHttpsAttributeTests.cs (3)
168var options = Options.Create(new MvcOptions()); 235var options = Options.Create(new MvcOptions()); 240services.AddSingleton<IOptions<MvcOptions>>(options);
ResponseCacheAttributeTest.cs (2)
326var optionsAccessor = Options.Create(new MvcOptions()); 336.Setup(s => s.GetService(typeof(IOptions<MvcOptions>)))
Routing\AttributeRoutingTest.cs (1)
166var routeOptions = new Mock<IOptions<RouteOptions>>();
Microsoft.AspNetCore.Mvc.Core.TestCommon (9)
TestModelBinderFactory.cs (7)
15var options = serviceProvider.GetRequiredService<IOptions<MvcOptions>>(); 36var options = Options.Create(new MvcOptions()); 58var options = Options.Create(new MvcOptions()); 67protected TestModelBinderFactory(IModelMetadataProvider metadataProvider, IOptions<MvcOptions> options) 74IOptions<MvcOptions> options, 80private static IServiceProvider GetServices(IOptions<MvcOptions> options)
TestModelMetadataProvider.cs (1)
18var localizationOptions = Options.Create(new MvcDataAnnotationsLocalizationOptions());
TestModelValidatorProvider.cs (1)
15var options = Options.Create(new MvcDataAnnotationsLocalizationOptions());
Microsoft.AspNetCore.Mvc.Cors (1)
CorsApplicationModelProvider.cs (1)
16public CorsApplicationModelProvider(IOptions<MvcOptions> mvcOptions)
Microsoft.AspNetCore.Mvc.Cors.Test (1)
CorsApplicationModelProviderTest.cs (1)
20private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false });
Microsoft.AspNetCore.Mvc.DataAnnotations (10)
DataAnnotationsClientModelValidatorProvider.cs (3)
20private readonly IOptions<MvcDataAnnotationsLocalizationOptions> _options; 29/// <param name="options">The <see cref="IOptions{MvcDataAnnotationsLocalizationOptions}"/>.</param> 33IOptions<MvcDataAnnotationsLocalizationOptions> options,
DataAnnotationsMetadataProvider.cs (1)
30IOptions<MvcDataAnnotationsLocalizationOptions> localizationOptions,
DataAnnotationsModelValidatorProvider.cs (3)
18private readonly IOptions<MvcDataAnnotationsLocalizationOptions> _options; 27/// <param name="options">The <see cref="IOptions{MvcDataAnnotationsLocalizationOptions}"/>.</param> 33IOptions<MvcDataAnnotationsLocalizationOptions> options,
DependencyInjection\MvcDataAnnotationsMvcOptionsSetup.cs (3)
18private readonly IOptions<MvcDataAnnotationsLocalizationOptions> _dataAnnotationLocalizationOptions; 22IOptions<MvcDataAnnotationsLocalizationOptions> dataAnnotationLocalizationOptions) 33IOptions<MvcDataAnnotationsLocalizationOptions> dataAnnotationLocalizationOptions,
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
MvcDataAnnotationsMvcOptionsSetup.cs (1)
21services.AddSingleton<IOptions<MvcDataAnnotationsLocalizationOptions>>(
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
224_mvcOptions ??= httpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>().Value;
XmlSerializerOutputFormatter.cs (1)
203_mvcOptions ??= httpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>().Value;
Microsoft.AspNetCore.Mvc.FunctionalTests (10)
AntiforgeryMiddlewareTest.cs (8)
37var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 121var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 153var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 185var antiforgeryOptions = app.Services.GetRequiredService<IOptions<AntiforgeryOptions>>();
SimpleWithWebApplicationBuilderTests.cs (2)
267var antiforgeryOptions = Factory.Services.GetRequiredService<IOptions<AntiforgeryOptions>>();
Microsoft.AspNetCore.Mvc.IntegrationTests (25)
BodyValidationIntegrationTests.cs (2)
453var options = testContext.GetService<IOptions<MvcNewtonsoftJsonOptions>>().Value; 559var options = testContext.GetService<IOptions<MvcNewtonsoftJsonOptions>>().Value;
HasValidatorsValidationMetadataProviderIntegrationTest.cs (4)
25var options = services.GetRequiredService<IOptions<MvcOptions>>(); 43var options = services.GetRequiredService<IOptions<MvcOptions>>();
ModelBindingTestHelper.cs (12)
31var options = services.GetRequiredService<IOptions<MvcOptions>>(); 70var options = serviceProvider.GetRequiredService<IOptions<MvcOptions>>(); 90var options = services.GetRequiredService<IOptions<MvcOptions>>(); 119var options = services.GetRequiredService<IOptions<MvcOptions>>(); 126IOptions<MvcOptions> options = null) 134private static IList<IModelValidatorProvider> GetModelValidatorProviders(IOptions<MvcOptions> options) 177var optionsAccessor = services.GetRequiredService<IOptions<MvcOptions>>();
ParameterBinderExtensions.cs (2)
21var optionsAccessor = context.HttpContext.RequestServices.GetService<IOptions<MvcOptions>>();
TestMvcOptions.cs (2)
24var dataAnnotationLocalizationOptions = Options.Create(new MvcDataAnnotationsLocalizationOptions()); 38var jsonOptions = Options.Create(new MvcNewtonsoftJsonOptions());
TryValidateModelIntegrationTest.cs (2)
213var options = actionContext.HttpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>();
ValidationIntegrationTests.cs (1)
2518var options = services.GetRequiredService<IOptions<MvcOptions>>().Value;
Microsoft.AspNetCore.Mvc.Localization.Test (8)
MvcLocalizationMvcBuilderExtensionsTest.cs (4)
97var actualOptions = serviceProvider.GetRequiredService<IOptions<LocalizationOptions>>(); 121var actualOptions = serviceProvider.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>();
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (4)
97var actualOptions = serviceProvider.GetRequiredService<IOptions<LocalizationOptions>>(); 121var actualOptions = serviceProvider.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>();
Microsoft.AspNetCore.Mvc.NewtonsoftJson (5)
DependencyInjection\NewtonsoftJsonMvcOptionsSetup.cs (1)
29IOptions<MvcNewtonsoftJsonOptions> jsonOptions,
NewtonsoftJsonHelper.cs (1)
30public NewtonsoftJsonHelper(IOptions<MvcNewtonsoftJsonOptions> options, ArrayPool<char> charPool)
NewtonsoftJsonOutputFormatter.cs (1)
140_jsonOptions ??= context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value;
NewtonsoftJsonResultExecutor.cs (2)
45IOptions<MvcOptions> mvcOptions, 46IOptions<MvcNewtonsoftJsonOptions> jsonOptions,
Microsoft.AspNetCore.Mvc.Razor (1)
RazorViewEngine.cs (1)
53IOptions<RazorViewEngineOptions> optionsAccessor,
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
PageActionDescriptorChangeProvider.cs (1)
23IOptions<RazorPagesOptions> razorPagesOptions)
RazorProjectPageRouteModelProvider.cs (1)
23IOptions<RazorPagesOptions> pagesOptionsAccessor,
RazorReferenceManager.cs (1)
24IOptions<MvcRazorRuntimeCompilationOptions> options)
RuntimeCompilationFileProvider.cs (1)
14public RuntimeCompilationFileProvider(IOptions<MvcRazorRuntimeCompilationOptions> options)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
FileProviderRazorProjectFileSystemTest.cs (1)
246var options = Options.Create(new MvcRazorRuntimeCompilationOptions
RuntimeCompilationFileProviderTest.cs (1)
19var options = Options.Create(new MvcRazorRuntimeCompilationOptions());
RuntimeViewCompilerTest.cs (1)
827var options = Options.Create(new MvcRazorRuntimeCompilationOptions
Microsoft.AspNetCore.Mvc.Razor.Test (7)
RazorViewEngineOptionsTest.cs (4)
34var accessor = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>(); 64var accessor = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>();
RazorViewEngineTest.cs (3)
2060private static IOptions<RazorViewEngineOptions> GetOptionsAccessor( 2111var optionsAccessor = new Mock<IOptions<RazorViewEngineOptions>>(); 2156IOptions<RazorViewEngineOptions> optionsAccessor)
Microsoft.AspNetCore.Mvc.RazorPages (18)
ApplicationModels\AuthorizationPageApplicationModelProvider.cs (1)
18IOptions<MvcOptions> mvcOptions)
ApplicationModels\CompiledPageRouteModelProvider.cs (1)
26IOptions<RazorPagesOptions> pagesOptionsAccessor,
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
28IOptions<RazorPagesOptions> razorPagesOptions,
ApplicationModels\PageConventionCollection.cs (1)
47_mvcOptions ??= _serviceProvider!.GetRequiredService<IOptions<MvcOptions>>().Value;
ApplicationModels\ResponseCacheFilterApplicationModelProvider.cs (1)
16public ResponseCacheFilterApplicationModelProvider(IOptions<MvcOptions> mvcOptionsAccessor, ILoggerFactory loggerFactory)
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
16public RazorPagesRazorViewEngineOptionsSetup(IOptions<RazorPagesOptions> pagesOptions)
Infrastructure\CompiledPageActionDescriptorProvider.cs (2)
36IOptions<MvcOptions> mvcOptions, 37IOptions<RazorPagesOptions> pageOptions)
Infrastructure\DefaultPageLoader.cs (2)
24IOptions<RazorPagesOptions> pageOptions, 25IOptions<MvcOptions> mvcOptions)
Infrastructure\PageActionDescriptorProvider.cs (2)
30IOptions<MvcOptions> mvcOptionsAccessor, 31IOptions<RazorPagesOptions> pagesOptionsAccessor)
Infrastructure\PageActionInvokerProvider.cs (2)
35IOptions<MvcOptions> mvcOptions, 36IOptions<MvcViewOptions> mvcViewOptions,
Infrastructure\PageRequestDelegateFactory.cs (4)
36IOptions<MvcOptions> mvcOptions, 37IOptions<MvcViewOptions> mvcViewOptions, 50IOptions<MvcOptions> mvcOptions, 51IOptions<MvcViewOptions> mvcViewOptions,
Microsoft.AspNetCore.Mvc.RazorPages.Test (21)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (2)
17private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false }); 110var options = Options.Create(new AuthorizationOptions());
ApplicationModels\CompiledPageRouteModelProviderTest.cs (1)
493IOptions<RazorPagesOptions> options,
ApplicationModels\ResponseCacheFilterApplicationModelProviderTest.cs (3)
22var options = Options.Create(new MvcOptions()); 56var options = Options.Create(new MvcOptions()); 98var options = Options.Create(new MvcOptions());
DependencyInjection\MvcRazorPagesMvcBuilderExtensionsTest.cs (2)
29var accessor = serviceProvider.GetRequiredService<IOptions<RazorPagesOptions>>();
DependencyInjection\PageConventionCollectionExtensionsTest.cs (1)
980.AddSingleton<IOptions<MvcOptions>>(Options.Options.Create(options))
Infrastructure\DefaultPageLoaderTest.cs (7)
20private readonly IOptions<RazorPagesOptions> RazorPagesOptions = Options.Create(new RazorPagesOptions { Conventions = new PageConventionCollection(Mock.Of<IServiceProvider>()) }); 37var mvcOptions = Options.Create(new MvcOptions()); 120var mvcOptions = Options.Create(new MvcOptions()); 160var mvcOptions = Options.Create(new MvcOptions()); 237var mvcOptions = Options.Create(new MvcOptions()); 299var mvcOptions = Options.Create(new MvcOptions()); 336var mvcOptions = Options.Create(new MvcOptions());
Infrastructure\PageActionDescriptorProviderTest.cs (4)
271var options = GetRazorPagesOptions(); 361private static IOptions<TOptions> GetAccessor<TOptions>(TOptions options = null) 364var accessor = new Mock<IOptions<TOptions>>(); 369private static IOptions<RazorPagesOptions> GetRazorPagesOptions()
Infrastructure\PageBinderFactoryTest.cs (1)
21private static readonly IOptions<MvcOptions> _optionsAccessor = Options.Create(_options);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
CacheTagHelperMemoryCacheFactory.cs (1)
19public CacheTagHelperMemoryCacheFactory(IOptions<CacheTagHelperOptions> options)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
DistributedCacheTagHelperTest.cs (1)
774private static IDistributedCacheTagHelperStorage GetStorage(IOptions<MemoryDistributedCacheOptions> options = null)
TestableHtmlGenerator.cs (3)
41IOptions<MvcViewOptions> options, 119private static IOptions<MvcViewOptions> GetOptions() 121var mockOptions = new Mock<IOptions<MvcViewOptions>>();
Microsoft.AspNetCore.Mvc.Test (1)
MvcOptionsSetupTest.cs (1)
281return serviceProvider.GetRequiredService<IOptions<T>>().Value;
Microsoft.AspNetCore.Mvc.ViewFeatures (19)
CookieTempDataProvider.cs (1)
41IOptions<CookieTempDataProviderOptions> options,
DefaultHtmlGenerator.cs (1)
57IOptions<MvcViewOptions> optionsAccessor,
DefaultValidationHtmlAttributeProvider.cs (1)
28IOptions<MvcViewOptions> optionsAccessor,
DependencyInjection\MvcViewOptionsSetup.cs (3)
16private readonly IOptions<MvcDataAnnotationsLocalizationOptions> _dataAnnotationsLocalizationOptions; 21IOptions<MvcDataAnnotationsLocalizationOptions> dataAnnotationLocalizationOptions, 32IOptions<MvcDataAnnotationsLocalizationOptions> dataAnnotationOptions,
Filters\AntiforgeryApplicationModelProvider.cs (1)
12internal sealed class AntiforgeryApplicationModelProvider(IOptions<MvcOptions> mvcOptions, ILogger<AntiforgeryMiddlewareAuthorizationFilter> logger) : IApplicationModelProvider
PartialViewResultExecutor.cs (2)
28/// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param> 36IOptions<MvcViewOptions> viewOptions,
RemoteAttributeBase.cs (2)
180var options = services.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>();
Rendering\SystemTextJsonHelper.cs (1)
15public SystemTextJsonHelper(IOptions<JsonOptions> options)
ViewComponentResultExecutor.cs (2)
38/// <param name="mvcHelperOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param> 45IOptions<MvcViewOptions> mvcHelperOptions,
ViewEngines\CompositeViewEngine.cs (1)
19public CompositeViewEngine(IOptions<MvcViewOptions> optionsAccessor)
ViewExecutor.cs (2)
32/// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param> 39IOptions<MvcViewOptions> viewOptions,
ViewResultExecutor.cs (2)
28/// <param name="viewOptions">The <see cref="IOptions{MvcViewOptions}"/>.</param> 36IOptions<MvcViewOptions> viewOptions,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (34)
CookieTempDataProviderTest.cs (1)
400var testOptions = new Mock<IOptions<CookieTempDataProviderOptions>>();
DefaultHtmlGeneratorTest.cs (1)
1004var mvcViewOptionsAccessor = new Mock<IOptions<MvcViewOptions>>();
DefaultValidationHtmlAttributeProviderTest.cs (1)
274var mvcViewOptionsAccessor = new Mock<IOptions<MvcViewOptions>>();
PageRemoteAttributeTest.cs (1)
193provider => new DefaultInlineConstraintResolver(provider.GetRequiredService<IOptions<RouteOptions>>(), provider));
PartialViewResultExecutorTest.cs (1)
358var options = Options.Create(new MvcViewOptions());
PartialViewResultTest.cs (1)
233var options = Options.Create(new MvcViewOptions());
RemoteAttributeBaseTest.cs (8)
223var options = context.ActionContext.HttpContext.RequestServices 224.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>(); 270var options = context.ActionContext.HttpContext.RequestServices 271.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>(); 315var options = context.ActionContext.HttpContext.RequestServices 316.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>(); 407var options = context.ActionContext.HttpContext.RequestServices 408.GetRequiredService<IOptions<MvcDataAnnotationsLocalizationOptions>>();
RemoteAttributeTest.cs (1)
494provider => new DefaultInlineConstraintResolver(provider.GetRequiredService<IOptions<RouteOptions>>(), provider));
Rendering\DefaultTemplatesUtilities.cs (1)
238var localizationOptionsAccesor = Options.Create(localizationOptions);
ViewEngines\CompositeViewEngineTest.cs (16)
20var optionsAccessor = Options.Create(new MvcViewOptions()); 40var optionsAccessor = Options.Create(new MvcViewOptions()); 58var optionsAccessor = Options.Create(new MvcViewOptions()); 80var optionsAccessor = Options.Create(new MvcViewOptions()); 112var optionsAccessor = Options.Create(new MvcViewOptions()); 145var optionsAccessor = Options.Create(new MvcViewOptions()); 168var optionsAccessor = Options.Create(new MvcViewOptions()); 190var optionsAccessor = Options.Create(new MvcViewOptions()); 215var optionsAccessor = Options.Create(new MvcViewOptions()); 250var optionsAccessor = Options.Create(new MvcViewOptions()); 286var optionsAccessor = Options.Create(new MvcViewOptions()); 307var optionsAccessor = Options.Create(new MvcViewOptions()); 325var optionsAccessor = Options.Create(new MvcViewOptions()); 347var optionsAccessor = Options.Create(new MvcViewOptions()); 379var optionsAccessor = Options.Create(new MvcViewOptions()); 412var optionsAccessor = Options.Create(new MvcViewOptions());
ViewResultExecutorTest.cs (1)
348var options = Options.Create(new MvcViewOptions());
ViewResultTest.cs (1)
245var options = Options.Create(new MvcViewOptions());
Microsoft.AspNetCore.Mvc.Views.TestCommon (1)
HtmlGeneratorUtilities.cs (1)
29var optionsAccessor = new Mock<IOptions<MvcViewOptions>>();
Microsoft.AspNetCore.OpenApi.Tests (4)
Services\OpenApiDocumentServiceTestsBase.cs (4)
63var optionsAccessor = Options.Create(options); 129var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()); 325if (serviceType == typeof(IOptions<RouteHandlerOptions>))
Microsoft.AspNetCore.OutputCaching (9)
OutputCacheKeyProvider.cs (1)
23internal OutputCacheKeyProvider(ObjectPoolProvider poolProvider, IOptions<OutputCacheOptions> options)
OutputCacheMiddleware.cs (2)
40IOptions<OutputCacheOptions> options, 56IOptions<OutputCacheOptions> options,
OutputCacheServiceCollectionExtensions.cs (2)
33var outputCacheOptions = sp.GetRequiredService<IOptions<OutputCacheOptions>>();
Policies\NamedPolicy.cs (2)
15private IOptions<OutputCacheOptions>? _options; 72_options ??= context.HttpContext.RequestServices.GetRequiredService<IOptions<OutputCacheOptions>>();
Policies\TypedPolicy.cs (2)
33var options = context.HttpContext.RequestServices.GetRequiredService<IOptions<OutputCacheOptions>>();
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (4)
RedisOutputCacheStore.cs (2)
52public RedisOutputCacheStore(IOptions<RedisOutputCacheOptions> optionsAccessor) // TODO: OC-specific options? 70internal RedisOutputCacheStore(IOptions<RedisOutputCacheOptions> optionsAccessor, ILogger logger)
RedisOutputCacheStoreImpl.cs (2)
11public RedisOutputCacheStoreImpl(IOptions<RedisOutputCacheOptions> optionsAccessor, ILogger<RedisOutputCacheStore> logger) 16public RedisOutputCacheStoreImpl(IOptions<RedisOutputCacheOptions> optionsAccessor)
Microsoft.AspNetCore.OutputCaching.Tests (2)
TestUtils.cs (2)
226serviceProvider.Setup(x => x.GetService(typeof(IOptions<OutputCacheOptions>))).Returns(Options.Create(options ?? new OutputCacheOptions())); 246serviceProvider.Setup(x => x.GetService(typeof(IOptions<OutputCacheOptions>))).Returns(Options.Create(options ?? new OutputCacheOptions()));
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
35public RateLimitingMiddleware(RequestDelegate next, ILogger<RateLimitingMiddleware> logger, IOptions<RateLimiterOptions> options, IServiceProvider serviceProvider, RateLimitingMetrics metrics)
Microsoft.AspNetCore.RateLimiting.Tests (27)
RateLimitingMetricsTests.cs (7)
30var options = CreateOptionsAccessor(); 70var options = CreateOptionsAccessor(); 129var options = CreateOptionsAccessor(); 187serviceProvider.GetRequiredService<IOptions<RateLimiterOptions>>(), 262serviceProvider.GetRequiredService<IOptions<RateLimiterOptions>>(), 335private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<RateLimiterOptions> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null, IMeterFactory meterFactory = null, RequestDelegate next = null) 346private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingMiddlewareTests.cs (20)
21var options = CreateOptionsAccessor(); 64var options = CreateOptionsAccessor(); 89var options = CreateOptionsAccessor(); 114var options = CreateOptionsAccessor(); 143var options = CreateOptionsAccessor(); 169var options = CreateOptionsAccessor(); 186var options = CreateOptionsAccessor(); 221var options = CreateOptionsAccessor(); 257var options = CreateOptionsAccessor(); 288var options = CreateOptionsAccessor(); 320var options = CreateOptionsAccessor(); 352var options = CreateOptionsAccessor(); 384var options = CreateOptionsAccessor(); 427var options = CreateOptionsAccessor(); 468var options = CreateOptionsAccessor(); 519var options = CreateOptionsAccessor(); 557var options = CreateOptionsAccessor(); 587var options = CreateOptionsAccessor(); 646private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<RateLimiterOptions> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null) => 656private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
Microsoft.AspNetCore.RequestDecompression (1)
DefaultRequestDecompressionProvider.cs (1)
20IOptions<RequestDecompressionOptions> options)
Microsoft.AspNetCore.RequestDecompression.Tests (6)
DefaultRequestDecompressionProviderTests.cs (6)
32var options = Options.Create(new RequestDecompressionOptions()); 58var options = Options.Create(new RequestDecompressionOptions()); 85var options = Options.Create(new RequestDecompressionOptions()); 113var options = Options.Create(new RequestDecompressionOptions()); 136IOptions<RequestDecompressionOptions> options = null; 150var options = Options.Create(new RequestDecompressionOptions());
Microsoft.AspNetCore.ResponseCaching (3)
ResponseCachingKeyProvider.cs (1)
22internal ResponseCachingKeyProvider(ObjectPoolProvider poolProvider, IOptions<ResponseCachingOptions> options)
ResponseCachingMiddleware.cs (2)
41IOptions<ResponseCachingOptions> options, 59IOptions<ResponseCachingOptions> options,
Microsoft.AspNetCore.ResponseCompression (5)
BrotliCompressionProvider.cs (1)
18public BrotliCompressionProvider(IOptions<BrotliCompressionProviderOptions> options)
BrotliCompressionProviderOptions.cs (1)
20BrotliCompressionProviderOptions IOptions<BrotliCompressionProviderOptions>.Value => this;
GzipCompressionProvider.cs (1)
18public GzipCompressionProvider(IOptions<GzipCompressionProviderOptions> options)
GzipCompressionProviderOptions.cs (1)
20GzipCompressionProviderOptions IOptions<GzipCompressionProviderOptions>.Value => this;
ResponseCompressionProvider.cs (1)
30public ResponseCompressionProvider(IServiceProvider services, IOptions<ResponseCompressionOptions> options)
Microsoft.AspNetCore.Rewrite (3)
RewriteBuilderExtensions.cs (2)
45private static IApplicationBuilder AddRewriteMiddleware(IApplicationBuilder app, IOptions<RewriteOptions>? options) 54options = app.ApplicationServices.GetRequiredService<IOptions<RewriteOptions>>();
RewriteMiddleware.cs (1)
36IOptions<RewriteOptions> options)
Microsoft.AspNetCore.Routing (11)
Builder\EndpointRouteBuilderExtensions.cs (2)
458var routeHandlerOptions = endpoints.ServiceProvider?.GetService<IOptions<RouteHandlerOptions>>();
Builder\EndpointRoutingApplicationBuilderExtensions.cs (2)
104var routeOptions = builder.ApplicationServices.GetRequiredService<IOptions<RouteOptions>>();
DefaultInlineConstraintResolver.cs (1)
31public DefaultInlineConstraintResolver(IOptions<RouteOptions> routeOptions, IServiceProvider serviceProvider)
DefaultLinkGenerator.cs (1)
41IOptions<RouteOptions> routeOptions,
DefaultParameterPolicyFactory.cs (1)
16IOptions<RouteOptions> options,
EndpointMiddleware.cs (1)
26IOptions<RouteOptions> routeOptions)
EndpointRoutingMiddleware.cs (1)
40IOptions<RouteOptions> routeOptions,
RequestDelegateFilterPipelineBuilder.cs (1)
22var jsonOptions = serviceProvider?.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
RouteCollection.cs (1)
195_options = context.RequestServices.GetRequiredService<IOptions<RouteOptions>>().Value;
Microsoft.AspNetCore.Routing.FunctionalTests (14)
MinimalFormTests.cs (14)
51var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 111var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 472var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 531var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 583var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 635var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>(); 684var antiforgeryOptions = host.Services.GetRequiredService<IOptions<AntiforgeryOptions>>();
Microsoft.AspNetCore.Routing.Tests (32)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (2)
323var routeOptions = app.ApplicationServices.GetRequiredService<IOptions<RouteOptions>>();
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1179else if (serviceType == typeof(IOptions<RouteHandlerOptions>))
DefaultInlineConstraintResolverTest.cs (1)
368var optionsAccessor = new Mock<IOptions<RouteOptions>>();
EndpointMiddlewareTest.cs (4)
16private readonly IOptions<RouteOptions> RouteOptions = Options.Create(new RouteOptions()); 205var routeOptions = Options.Create(new RouteOptions { SuppressCheckForUnhandledSecurityMetadata = true }); 302var routeOptions = Options.Create(new RouteOptions { SuppressCheckForUnhandledSecurityMetadata = true }); 400var routeOptions = Options.Create(new RouteOptions { SuppressCheckForUnhandledSecurityMetadata = true });
InlineRouteParameterParserTests.cs (2)
965var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
LinkGeneratorTestBase.cs (2)
71var routeOptions = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
LinkParserTestBase.cs (2)
63var routeOptions = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
RouteCollectionTest.cs (2)
659var optionsAccessor = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict); 665context.Setup(m => m.RequestServices.GetService(typeof(IOptions<RouteOptions>)))
RouteConstraintBuilderTest.cs (1)
179var options = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict);
RouteHandlerOptionsTests.cs (4)
29var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>().Value; 53var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>().Value; 65var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>();
RouteOptionsTests.cs (3)
24var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>(); 40var options = serviceProvider.GetRequiredService<IOptions<RouteOptions>>().Value;
RouteTest.cs (1)
1853var routeOptionsMock = new Mock<IOptions<RouteOptions>>();
RoutingServiceCollectionExtensionsTests.cs (2)
79var options = provider.GetService<IOptions<RouteOptions>>();
TemplateParserDefaultValuesTests.cs (2)
148var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
Tree\TreeRouteBuilderTest.cs (2)
259var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
Tree\TreeRouterTest.cs (1)
2063var optionsMock = new Mock<IOptions<RouteOptions>>();
Microsoft.AspNetCore.Server.HttpSys (2)
MessagePump.cs (1)
30public MessagePump(IOptions<HttpSysOptions> options, ILoggerFactory loggerFactory, IAuthenticationSchemeProvider authentication)
WebHostBuilderHttpSysExtensions.cs (1)
40var options = services.GetRequiredService<IOptions<HttpSysOptions>>().Value;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
32IOptions<Http2CatOptions> options, IHostApplicationLifetime hostApplicationLifetime)
Utilities.cs (2)
106var options = host.Services.GetRequiredService<IOptions<HttpSysOptions>>();
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpServer.cs (1)
63IOptions<IISServerOptions> options,
Microsoft.AspNetCore.Server.IISIntegration (2)
IISMiddleware.cs (2)
50IOptions<IISOptions> options, 70IOptions<IISOptions> options,
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Internal\KestrelServerImpl.cs (2)
37IOptions<KestrelServerOptions> options, 75private static ServiceContext CreateServiceContext(IOptions<KestrelServerOptions> options, ILoggerFactory loggerFactory, DiagnosticSource? diagnosticSource, KestrelMetrics metrics)
KestrelServer.cs (2)
28/// <param name="options">The Kestrel <see cref="IOptions{TOptions}"/>.</param> 31public KestrelServer(IOptions<KestrelServerOptions> options, IConnectionListenerFactory transportFactory, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeTransportFactory.cs (1)
23IOptions<NamedPipeTransportOptions> options,
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
QuicTransportFactory.cs (1)
21public QuicTransportFactory(ILoggerFactory loggerFactory, IOptions<QuicTransportOptions> options)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
Client\SocketConnectionFactory.cs (1)
24public SocketConnectionFactory(IOptions<SocketTransportOptions> options, ILoggerFactory loggerFactory)
SocketTransportFactory.cs (1)
26IOptions<SocketTransportOptions> options,
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
40IOptions<SessionOptions> options)
Microsoft.AspNetCore.SignalR.Client (1)
HubConnectionBuilderHttpExtensions.cs (1)
170public HttpConnectionOptionsDerivedHttpEndPoint(IOptions<HttpConnectionOptions> httpConnectionOptions)
Microsoft.AspNetCore.SignalR.Client.Core (3)
HubConnection.cs (3)
246var options = serviceProvider.GetService<IOptions<HubConnectionOptions>>(); 2162_hubConnection._serviceProvider.GetService<IOptions<HubConnectionOptions>>()?.Value.StatefulReconnectBufferSize
Microsoft.AspNetCore.SignalR.Client.Tests (5)
HubConnectionBuilderExtensionsTests.cs (5)
27var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 40var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 54var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 70var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value; 85var value = serviceProvider.GetService<IOptions<HttpConnectionOptions>>().Value;
Microsoft.AspNetCore.SignalR.Core (3)
HubConnectionHandler.cs (2)
51IOptions<HubOptions> globalHubOptions, 52IOptions<HubOptions<THub>> hubOptions,
HubOptionsSetup`T.cs (1)
20public HubOptionsSetup(IOptions<HubOptions> options)
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
RedisHubLifetimeManagerBenchmark.cs (1)
40var options = Options.Create(new RedisOptions()
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
68public JsonHubProtocol(IOptions<JsonHubProtocolOptions> options)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocol.cs (1)
46public MessagePackHubProtocol(IOptions<MessagePackHubProtocolOptions> options)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
58public NewtonsoftJsonHubProtocol(IOptions<NewtonsoftJsonHubProtocolOptions> options)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (4)
RedisHubLifetimeManager.cs (4)
51IOptions<RedisOptions> options, 66IOptions<RedisOptions> options, 68IOptions<HubOptions>? globalHubOptions, 69IOptions<HubOptions<THub>>? hubOptions)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
RedisDependencyInjectionExtensionsTests.cs (2)
27var options = provider.GetService<IOptions<RedisOptions>>();
Microsoft.AspNetCore.SignalR.Tests (15)
AddSignalRTests.cs (9)
86Assert.Single(serviceProvider.GetRequiredService<IOptions<HubOptions>>().Value.SupportedProtocols); 87Assert.Empty(serviceProvider.GetRequiredService<IOptions<HubOptions<CustomHub>>>().Value.SupportedProtocols); 89Assert.Null(serviceProvider.GetRequiredService<IOptions<HubOptions>>().Value.HubFilters); 90Assert.Single(serviceProvider.GetRequiredService<IOptions<HubOptions<CustomHub>>>().Value.HubFilters); 103var hubOptions = serviceProvider.GetRequiredService<IOptions<HubOptions<CustomHub>>>().Value; 104var globalHubOptions = serviceProvider.GetRequiredService<IOptions<HubOptions>>().Value; 130Assert.Equal(42, serviceProvider.GetRequiredService<IOptions<HubOptions<CustomHub>>>().Value.StreamBufferCapacity); 156var globalOptions = serviceProvider.GetRequiredService<IOptions<HubOptions>>().Value; 182Assert.Collection(serviceProvider.GetRequiredService<IOptions<HubOptions<CustomHub>>>().Value.SupportedProtocols,
HubConnectionHandlerTests.cs (6)
2457var msgPackOptions = serviceProvider.GetRequiredService<IOptions<MessagePackHubProtocolOptions>>(); 2495var msgPackOptions = serviceProvider.GetRequiredService<IOptions<MessagePackHubProtocolOptions>>(); 2519var msgPackOptions = serviceProvider.GetRequiredService<IOptions<MessagePackHubProtocolOptions>>();
Microsoft.AspNetCore.SpaProxy (3)
SpaProxyLaunchManager.cs (1)
26IOptions<SpaDevelopmentServerOptions> options)
SpaProxyMiddleware.cs (2)
26private readonly IOptions<SpaDevelopmentServerOptions> _options; 33IOptions<SpaDevelopmentServerOptions> options,
Microsoft.AspNetCore.SpaServices.Extensions (4)
SpaApplicationBuilderExtensions.cs (2)
34var optionsProvider = app.ApplicationServices.GetService<IOptions<SpaOptions>>()!;
StaticFiles\SpaStaticFilesExtensions.cs (2)
30var optionsProvider = serviceProvider.GetService<IOptions<SpaStaticFilesOptions>>()!;
Microsoft.AspNetCore.StaticFiles (4)
DefaultFilesMiddleware.cs (1)
30public DefaultFilesMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DefaultFilesOptions> options)
DirectoryBrowserMiddleware.cs (2)
30public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DirectoryBrowserOptions> options) 42public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, HtmlEncoder encoder, IOptions<DirectoryBrowserOptions> options)
StaticFileMiddleware.cs (1)
32public StaticFileMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<StaticFileOptions> options, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.TestHost (2)
TestServer.cs (2)
35public TestServer(IServiceProvider services, IOptions<TestServerOptions> optionsAccessor) 46public TestServer(IServiceProvider services, IFeatureCollection featureCollection, IOptions<TestServerOptions> optionsAccessor)
Microsoft.AspNetCore.Testing (1)
ServiceFakesHostExtensions.cs (1)
45var certificate = host.Services.GetService<IOptions<FakeCertificateOptions>>()?.Value.Certificate;
Microsoft.AspNetCore.Testing.Tests (1)
FakesExtensionsTests.cs (1)
56var certificate = host.Services.GetRequiredService<IOptions<FakeCertificateOptions>>().Value.Certificate;
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (1)
2424Assert.Contains(builder.Services, service => service.ServiceType == typeof(IOptions<>));
WebHostTests.cs (2)
121var routeOptions = host.Services.GetService<IOptions<RouteOptions>>();
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
35public WebSocketMiddleware(RequestDelegate next, IOptions<WebSocketOptions> options, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.WebSockets.Tests (1)
AddWebSocketsTests.cs (1)
25var socketOptions = services.GetRequiredService<IOptions<WebSocketOptions>>().Value;
Microsoft.Extensions.AmbientMetadata.Application.Tests (3)
AcceptanceTests.cs (1)
59await func(host.Services.GetRequiredService<IOptions<ApplicationMetadata>>().Value,
ApplicationMetadataExtensionsTests.cs (2)
114var actualMetadata = provider.GetRequiredService<IOptions<ApplicationMetadata>>().Value; 140var actualMetadata = provider.GetRequiredService<IOptions<ApplicationMetadata>>().Value;
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.cs (1)
59public DefaultHybridCache(IOptions<HybridCacheOptions> options, IServiceProvider services)
Microsoft.Extensions.Caching.Hybrid.Tests (7)
BufferReleaseTests.cs (1)
80public TestCache(IOptions<MemoryDistributedCacheOptions> options)
L2Tests.cs (2)
28private class Options<T>(T value) : IOptions<T> 31T IOptions<T>.Value => value;
ServiceConstructionTests.cs (4)
209public CustomMemoryCache(IOptions<MemoryCacheOptions> options) 214public CustomMemoryCache(IOptions<MemoryCacheOptions> options, ILoggerFactory loggerFactory) 222public CustomMemoryDistributedCache(IOptions<MemoryDistributedCacheOptions> options) 227public CustomMemoryDistributedCache(IOptions<MemoryDistributedCacheOptions> options, ILoggerFactory loggerFactory)
Microsoft.Extensions.Caching.Memory (5)
MemoryCache.cs (2)
39public MemoryCache(IOptions<MemoryCacheOptions> optionsAccessor) 47public MemoryCache(IOptions<MemoryCacheOptions> optionsAccessor, ILoggerFactory loggerFactory)
MemoryCacheOptions.cs (1)
101MemoryCacheOptions IOptions<MemoryCacheOptions>.Value
MemoryDistributedCache.cs (2)
25public MemoryDistributedCache(IOptions<MemoryDistributedCacheOptions> optionsAccessor) 33public MemoryDistributedCache(IOptions<MemoryDistributedCacheOptions> optionsAccessor, ILoggerFactory loggerFactory)
Microsoft.Extensions.Caching.SqlServer (2)
SqlServerCache.cs (1)
36public SqlServerCache(IOptions<SqlServerCacheOptions> options)
SqlServerCacheOptions.cs (1)
46SqlServerCacheOptions IOptions<SqlServerCacheOptions>.Value
Microsoft.Extensions.Caching.StackExchangeRedis (5)
RedisCache.cs (2)
82public RedisCache(IOptions<RedisCacheOptions> optionsAccessor) 92internal RedisCache(IOptions<RedisCacheOptions> optionsAccessor, ILogger logger)
RedisCacheImpl.cs (2)
11public RedisCacheImpl(IOptions<RedisCacheOptions> optionsAccessor, ILogger<RedisCache> logger) 16public RedisCacheImpl(IOptions<RedisCacheOptions> optionsAccessor)
RedisCacheOptions.cs (1)
45RedisCacheOptions IOptions<RedisCacheOptions>.Value
Microsoft.Extensions.Compliance.Redaction (2)
HmacRedactor.cs (1)
43public HmacRedactor(IOptions<HmacRedactorOptions> options)
RedactorProvider.cs (1)
20public RedactorProvider(IEnumerable<Redactor> redactors, IOptions<RedactorProviderOptions> options)
Microsoft.Extensions.Compliance.Testing (4)
FakeRedactionServiceCollectionExtensions.cs (2)
32var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value; 58var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value;
FakeRedactor.cs (2)
39public FakeRedactor(IOptions<FakeRedactorOptions>? options = null, FakeRedactionCollector? collector = null) 41var opt = options ?? Microsoft.Extensions.Options.Options.Create(new FakeRedactorOptions());
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
AutoActivationHostedService.cs (1)
18public AutoActivationHostedService(IServiceProvider provider, IOptions<AutoActivatorOptions> options)
Microsoft.Extensions.Diagnostics.HealthChecks (6)
DefaultHealthCheckService.cs (2)
21private readonly IOptions<HealthCheckServiceOptions> _options; 26IOptions<HealthCheckServiceOptions> options,
HealthCheckPublisherHostedService.cs (4)
22private readonly IOptions<HealthCheckServiceOptions> _healthCheckServiceOptions; 23private readonly IOptions<HealthCheckPublisherOptions> _healthCheckPublisherOptions; 33IOptions<HealthCheckServiceOptions> healthCheckServiceOptions, 34IOptions<HealthCheckPublisherOptions> healthCheckPublisherOptions,
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
TelemetryHealthCheckPublisher.cs (1)
28public TelemetryHealthCheckPublisher(HealthCheckMetrics metrics, ILogger<TelemetryHealthCheckPublisher> logger, IOptions<TelemetryHealthCheckPublisherOptions> options)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
ApplicationLifecycleHealthChecksExtensionsTests.cs (1)
56var registrations = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value.Registrations;
ManualHealthCheckExtensionsTests.cs (1)
51var registrations = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value.Registrations;
TelemetryHealthChecksPublisherTests.cs (1)
94var options = Options.Options.Create(new TelemetryHealthCheckPublisherOptions
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (12)
DefaultHealthCheckServiceTest.cs (2)
43var options = services.GetRequiredService<IOptions<HealthCheckServiceOptions>>();
DependencyInjection\HealthChecksBuilderTest.cs (10)
32var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 52var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 75var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 97var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 123var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 146var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 169var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 192var options = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value; 214var options = services.BuildServiceProvider().GetRequiredService<IOptions<HealthCheckServiceOptions>>();
Microsoft.Extensions.Diagnostics.Probes.Tests (4)
TcpEndpointProbesExtensionsTests.cs (4)
56var configurations = host.Services.GetServices<IOptions<TcpEndpointProbesOptions>>(); 59var config = Assert.Single(configurations); 119var configurations = host.Services.GetServices<IOptions<TcpEndpointProbesOptions>>(); 122var configuration = Assert.Single(configurations);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (7)
Linux\LinuxUtilizationProvider.cs (1)
39public LinuxUtilizationProvider(IOptions<ResourceMonitoringOptions> options, ILinuxUtilizationParser parser,
Linux\Network\LinuxTcpStateInfo.cs (1)
20public LinuxTcpStateInfo(IOptions<ResourceMonitoringOptions> options, LinuxNetworkUtilizationParser parser)
ResourceMonitorService.cs (2)
57IOptions<ResourceMonitoringOptions> options, 66IOptions<ResourceMonitoringOptions> options,
Windows\Network\WindowsTcpStateInfo.cs (1)
28public WindowsTcpStateInfo(IOptions<ResourceMonitoringOptions> options)
Windows\WindowsContainerSnapshotProvider.cs (1)
51IOptions<ResourceMonitoringOptions> options)
Windows\WindowsSnapshotProvider.cs (1)
39public WindowsSnapshotProvider(ILogger<WindowsSnapshotProvider>? logger, IMeterFactory meterFactory, IOptions<ResourceMonitoringOptions> options)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (17)
Linux\AcceptanceTest.cs (4)
63var options = services.GetRequiredService<IOptions<ResourceMonitoringOptions>>(); 85var options = services.GetRequiredService<IOptions<ResourceMonitoringOptions>>();
Linux\LinuxCountersTests.cs (1)
78var options = Microsoft.Extensions.Options.Options.Create<ResourceMonitoringOptions>(new());
Linux\LinuxUtilizationProviderTests.cs (4)
31var options = Options.Options.Create(new ResourceMonitoringOptions()); 101var options = Options.Options.Create<ResourceMonitoringOptions>(new()); 169var options = Options.Options.Create<ResourceMonitoringOptions>(new()); 199var options = Options.Options.Create<ResourceMonitoringOptions>(new());
ResourceMonitoringExtensionsTests.cs (6)
104var options = host.Services.GetService<IOptions<ResourceMonitoringOptions>>(); 135var options = host.Services.GetService<IOptions<ResourceMonitoringOptions>>(); 175var options = host.Services.GetService<IOptions<ResourceMonitoringOptions>>();
Windows\WindowsContainerSnapshotProviderTests.cs (1)
331var options = Options.Options.Create<ResourceMonitoringOptions>(new());
Windows\WindowsSnapshotProviderTests.cs (1)
29private readonly IOptions<ResourceMonitoringOptions> _options;
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogCollector.cs (1)
26public FakeLogCollector(IOptions<FakeLogCollectorOptions> options)
Microsoft.Extensions.Hosting (6)
HostBuilder.cs (1)
326appServices.GetRequiredService<IOptions<HostOptions>>());
Internal\ConsoleLifetime.cs (4)
34public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions) 46public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions, ILoggerFactory loggerFactory)
Internal\Host.cs (1)
40IOptions<HostOptions> options)
Microsoft.Extensions.Hosting.WindowsServices (5)
WindowsServiceLifetime.cs (5)
32/// <param name="optionsAccessor">The <see cref="IOptions{HostOptions}"/> containing options for the service.</param> 33public WindowsServiceLifetime(IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IOptions<HostOptions> optionsAccessor) 44/// <param name="optionsAccessor">The <see cref="IOptions{HostOptions}"/> containing options for the service.</param> 46public WindowsServiceLifetime(IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IOptions<HostOptions> optionsAccessor, IOptions<WindowsServiceLifetimeOptions> windowsServiceOptionsAccessor)
Microsoft.Extensions.Http.Diagnostics (2)
Latency\Internal\HttpLatencyTelemetryHandler.cs (2)
27IOptions<HttpClientLatencyTelemetryOptions> options, IOptions<ApplicationMetadata> appMetdata)
Microsoft.Extensions.Http.Diagnostics.Tests (13)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (3)
49var options = sp.GetRequiredService<IOptions<HttpClientLatencyTelemetryOptions>>().Value; 83var options = sp.GetRequiredService<IOptions<HttpClientLatencyTelemetryOptions>>().Value; 103var options = sp.GetRequiredService<IOptions<HttpClientLatencyTelemetryOptions>>().Value;
Latency\Internal\HttpLatencyTelemetryHandlerTest.cs (6)
27var sop = new Mock<IOptions<ApplicationMetadata>>(); 29var hop = new Mock<IOptions<HttpClientLatencyTelemetryOptions>>(); 48var sop = new Mock<IOptions<ApplicationMetadata>>(); 50var hop = new Mock<IOptions<HttpClientLatencyTelemetryOptions>>(); 90var sop = new Mock<IOptions<ApplicationMetadata>>(); 92var hop = new Mock<IOptions<HttpClientLatencyTelemetryOptions>>();
Logging\AcceptanceTests.cs (1)
561var optionsSixth = provider.GetRequiredService<IOptions<LoggingOptions>>().Value;
Logging\HttpClientLoggingExtensionsTest.cs (3)
139var options = provider.GetRequiredService<IOptions<LoggingOptions>>().Value; 288var options = provider.GetRequiredService<IOptions<LoggingOptions>>().Value; 385.GetRequiredService<IOptions<LoggingOptions>>().Value;
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (1)
174var registryOptions = serviceProvider.GetRequiredService<IOptions<ResiliencePipelineRegistryOptions<HttpKey>>>().Value;
Microsoft.Extensions.Identity.Core (4)
PasswordHasher.cs (1)
45public PasswordHasher(IOptions<PasswordHasherOptions>? optionsAccessor = null)
UserClaimsPrincipalFactory.cs (2)
26IOptions<IdentityOptions> optionsAccessor) 116public UserClaimsPrincipalFactory(UserManager<TUser> userManager, RoleManager<TRole> roleManager, IOptions<IdentityOptions> options)
UserManager.cs (1)
70IOptions<IdentityOptions> optionsAccessor,
Microsoft.Extensions.Localization (2)
ResourceManagerStringLocalizerFactory.cs (2)
34/// <param name="localizationOptions">The <see cref="IOptions{LocalizationOptions}"/>.</param> 37IOptions<LocalizationOptions> localizationOptions,
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
StringLocalizerOfTRootNamespaceTest.cs (1)
18var options = new Mock<IOptions<LocalizationOptions>>();
Microsoft.Extensions.Localization.Tests (12)
ResourceManagerStringLocalizerFactoryTest.cs (12)
28IOptions<LocalizationOptions> localizationOptions, 64var options = new Mock<IOptions<LocalizationOptions>>(); 96var options = new Mock<IOptions<LocalizationOptions>>(); 114var options = new Mock<IOptions<LocalizationOptions>>(); 132var options = new Mock<IOptions<LocalizationOptions>>(); 160var options = new Mock<IOptions<LocalizationOptions>>(); 190var options = new Mock<IOptions<LocalizationOptions>>(); 211var options = new Mock<IOptions<LocalizationOptions>>(); 230var options = new Mock<IOptions<LocalizationOptions>>(); 249var options = new Mock<IOptions<LocalizationOptions>>(); 270var options = new Mock<IOptions<LocalizationOptions>>(); 291var options = new Mock<IOptions<LocalizationOptions>>();
Microsoft.Extensions.Logging (2)
LoggerFactory.cs (2)
70public LoggerFactory(IEnumerable<ILoggerProvider> providers, IOptionsMonitor<LoggerFilterOptions> filterOption, IOptions<LoggerFactoryOptions>? options) : this(providers, filterOption, options, null) 81public LoggerFactory(IEnumerable<ILoggerProvider> providers, IOptionsMonitor<LoggerFilterOptions> filterOption, IOptions<LoggerFactoryOptions>? options = null, IExternalScopeProvider? scopeProvider = null)
Microsoft.Extensions.Logging.EventLog (2)
EventLogLoggerProvider.cs (2)
38/// <param name="options">The <see cref="IOptions{EventLogSettings}"/>.</param> 39public EventLogLoggerProvider(IOptions<EventLogSettings> options)
Microsoft.Extensions.ML (5)
ModelLoaders\FileModelLoader.cs (1)
28public FileModelLoader(IOptions<MLOptions> contextOptions, ILogger<FileModelLoader> logger)
ModelLoaders\UriModelLoader.cs (1)
35public UriModelLoader(IOptions<MLOptions> contextOptions, ILogger<UriModelLoader> logger)
PoolLoader.cs (2)
27var contextOptions = sp.GetRequiredService<IOptions<MLOptions>>();
PredictionEnginePool.cs (1)
28IOptions<MLOptions> mlContextOptions,
Microsoft.Extensions.ML.Tests (3)
FileLoaderTests.cs (2)
51var context = sp.GetRequiredService<IOptions<MLOptions>>().Value.MLContext; 82public FileLoaderMock(IOptions<MLOptions> contextOptions, ILogger<FileModelLoader> logger)
UriLoaderTests.cs (1)
85public UriLoaderMock(IOptions<MLOptions> contextOptions,
Microsoft.Extensions.Options (5)
Options.cs (2)
22/// Creates a wrapper around an instance of <typeparamref name="TOptions"/> to return itself as an <see cref="IOptions{TOptions}"/>. 27public static IOptions<TOptions> Create<[DynamicallyAccessedMembers(DynamicallyAccessedMembers)] TOptions>(TOptions options)
OptionsManager.cs (1)
10/// Implements <see cref="IOptions{TOptions}"/> and <see cref="IOptionsSnapshot{TOptions}"/>.
OptionsServiceCollectionExtensions.cs (1)
26services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptions<>), typeof(UnnamedOptionsManager<>)));
ValidateOnStart.cs (1)
15public StartupValidator(IOptions<StartupValidatorOptions> validators)
Microsoft.Extensions.Resilience.Tests (2)
Resilience\ResilienceServiceCollectionExtensionsTests.cs (2)
38var enrichers = _services.BuildServiceProvider().GetRequiredService<IOptions<TelemetryOptions>>().Value.MeteringEnrichers; 48var enrichers = services.BuildServiceProvider().GetRequiredService<IOptions<TelemetryOptions>>().Value.MeteringEnrichers;
Microsoft.Extensions.ServiceDiscovery (15)
Configuration\ConfigurationServiceEndpointProvider.cs (3)
24private readonly IOptions<ConfigurationServiceEndpointProviderOptions> _options; 38IOptions<ConfigurationServiceEndpointProviderOptions> options, 39IOptions<ServiceDiscoveryOptions> serviceDiscoveryOptions)
Configuration\ConfigurationServiceEndpointProviderFactory.cs (2)
16IOptions<ConfigurationServiceEndpointProviderOptions> options, 17IOptions<ServiceDiscoveryOptions> serviceDiscoveryOptions,
Http\ResolvingHttpClientHandler.cs (1)
11internal sealed class ResolvingHttpClientHandler(HttpServiceEndpointResolver resolver, IOptions<ServiceDiscoveryOptions> options) : HttpClientHandler
Http\ResolvingHttpDelegatingHandler.cs (2)
22public ResolvingHttpDelegatingHandler(HttpServiceEndpointResolver resolver, IOptions<ServiceDiscoveryOptions> options) 34public ResolvingHttpDelegatingHandler(HttpServiceEndpointResolver resolver, IOptions<ServiceDiscoveryOptions> options, HttpMessageHandler innerHandler) : base(innerHandler)
Http\ServiceDiscoveryHttpMessageHandlerFactory.cs (1)
12IOptions<ServiceDiscoveryOptions> options) : IServiceDiscoveryHttpMessageHandlerFactory
ServiceDiscoveryHttpClientBuilderExtensions.cs (3)
31var options = services.GetRequiredService<IOptions<ServiceDiscoveryOptions>>(); 62public DisableGrpcLoadBalancingFilter(IOptions<DisableGrpcLoadBalancingFilterOptions> options)
ServiceEndpointWatcher.cs (1)
21IOptions<ServiceDiscoveryOptions> options) : IAsyncDisposable
ServiceEndpointWatcherFactory.cs (2)
16IOptions<ServiceDiscoveryOptions> options, 24private readonly IOptions<ServiceDiscoveryOptions> _options = options;
Microsoft.Extensions.ServiceDiscovery.Yarp (1)
ServiceDiscoveryDestinationResolver.cs (1)
19internal sealed class ServiceDiscoveryDestinationResolver(ServiceEndpointResolver resolver, IOptions<ServiceDiscoveryOptions> options) : IDestinationResolver
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (1)
YarpServiceDiscoveryTests.cs (1)
26serviceProvider.GetRequiredService<IOptions<ServiceDiscoveryOptions>>());
Microsoft.Extensions.Telemetry (8)
Enrichment\ApplicationLogEnricher.cs (2)
17IOptions<ApplicationLogEnricherOptions> options, 18IOptions<ApplicationMetadata> metadata)
Enrichment\ProcessLogEnricher.cs (1)
20public ProcessLogEnricher(IOptions<ProcessLogEnricherOptions> options)
Enrichment\StaticProcessLogEnricher.cs (1)
18public StaticProcessLogEnricher(IOptions<ProcessLogEnricherOptions> options)
Latency\Internal\LatencyConsoleExporter.cs (1)
35public LatencyConsoleExporter(IOptions<LatencyConsoleOptions> options)
Latency\Internal\LatencyContextRegistrySet.cs (2)
31public LatencyContextRegistrySet(IOptions<LatencyContextOptions> latencyContextOptions, 32IOptions<LatencyContextRegistrationOptions>? registrationOptions = null)
Logging\ExtendedLoggerFactory.cs (1)
38IOptions<LoggerFactoryOptions>? factoryOptions = null,
Microsoft.Extensions.Telemetry.Abstractions.Tests (2)
Latency\LatencyRegistryExtensionsTests.cs (2)
45var option = serviceProvider.GetService<IOptions<LatencyContextRegistrationOptions>>();
Microsoft.Extensions.Telemetry.Tests (35)
Enrichment\ApplicationEnricherExtensionsTests.cs (2)
62var options = host.Services.GetRequiredService<IOptions<ApplicationLogEnricherOptions>>().Value; 88var options = host.Services.GetRequiredService<IOptions<ApplicationLogEnricherOptions>>().Value;
Enrichment\ApplicationLogEnricherTests.cs (5)
34var options = new ApplicationLogEnricherOptions 39var optionsNull = new Mock<IOptions<ApplicationLogEnricherOptions>>(); 40optionsNull.Setup(o => o.Value).Returns<IOptions<ApplicationLogEnricherOptions>>(null!); 42var serviceOptionsNull = new Mock<IOptions<ApplicationMetadata>>(); 43serviceOptionsNull.Setup(o => o.Value).Returns<IOptions<ApplicationMetadata>>(null!);
Enrichment\Internals\TestExtensions.cs (2)
11public static IOptions<T> ToOptions<T>(this T options) 14var mock = new Mock<IOptions<T>>();
Enrichment\ProcessEnricherExtensionsTests.cs (2)
63var options = host.Services.GetRequiredService<IOptions<ProcessLogEnricherOptions>>().Value; 86var options = host.Services.GetRequiredService<IOptions<ProcessLogEnricherOptions>>().Value;
Enrichment\ProcessLogEnricherTests.cs (2)
23var optionsNull = new Mock<IOptions<ProcessLogEnricherOptions>>(); 24optionsNull.Setup(o => o.Value).Returns<IOptions<ProcessLogEnricherOptions>>(null!);
Latency\Internal\LatencyConsoleExporterTests.cs (4)
75var options = Options.Options.Create(new LatencyConsoleOptions 97var options = Options.Options.Create(new LatencyConsoleOptions 119var options = Options.Options.Create(new LatencyConsoleOptions 141var options = Options.Options.Create(new LatencyConsoleOptions
Latency\Internal\LatencyContextPoolTests.cs (2)
98var option = MockLatencyContextRegistrationOptions.GetLatencyContextRegistrationOptions( 101var lco = new Mock<IOptions<LatencyContextOptions>>();
Latency\Internal\LatencyContextProviderTests.cs (3)
98var lco = new Mock<IOptions<LatencyContextOptions>>(); 108var lco = new Mock<IOptions<LatencyContextOptions>>(); 115private static IOptions<LatencyContextRegistrationOptions> GetRegistrationOption()
Latency\Internal\LatencyContextRegistrySetTests.cs (3)
17var lco = new Mock<IOptions<LatencyContextOptions>>(); 84var lco = new Mock<IOptions<LatencyContextOptions>>(); 87var o = MockLatencyContextRegistrationOptions.GetLatencyContextRegistrationOptions(checkpoints, measures, tags);
Latency\Internal\LatencyContextTests.cs (2)
295var option = MockLatencyContextRegistrationOptions.GetLatencyContextRegistrationOptions( 297var lco = new Mock<IOptions<LatencyContextOptions>>();
Latency\Internal\LatencyContextTokenIssuerTests.cs (2)
64var option = MockLatencyContextRegistrationOptions.GetLatencyContextRegistrationOptions( 66var lco = new Mock<IOptions<LatencyContextOptions>>();
Latency\Internal\MockLatencyContextRegistrationOptions.cs (2)
10public static IOptions<LatencyContextRegistrationOptions> GetLatencyContextRegistrationOptions( 22var lcro = new Mock<IOptions<LatencyContextRegistrationOptions>>();
Latency\LatencyConsoleExtensionsTests.cs (2)
62var actualOptions = provider.GetRequiredService<IOptions<LatencyConsoleOptions>>();
Latency\LatencyContextExtensionTests.cs (2)
98var actualOptions = provider.GetRequiredService<IOptions<LatencyContextOptions>>();
Microsoft.Extensions.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
67?.GetService<IOptions<WebEncoderOptions>>()
RoutingSandbox (1)
HelloExtension\HelloMiddleware.cs (1)
15public HelloMiddleware(RequestDelegate next, IOptions<HelloOptions> helloOptions)
RoutingWebSite (1)
HelloExtension\HelloMiddleware.cs (1)
15public HelloMiddleware(RequestDelegate next, IOptions<HelloOptions> helloOptions)
Sockets.BindTests (2)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (2)
330var options = ((IOptions<KestrelServerOptions>)host.Services.GetService(typeof(IOptions<KestrelServerOptions>))).Value;
XmlFormattersWebSite (4)
Controllers\XmlDataContractApiController.cs (2)
26var mvcOptions = context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>();
Controllers\XmlSerializedApiController.cs (2)
26var mvcOptions = context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcOptions>>();