16 implementations of Value
Microsoft.AspNetCore.Antiforgery.Test (2)
DefaultAntiforgeryTest.cs (1)
1571public AntiforgeryOptions Value { get; set; } = new AntiforgeryOptions();
TestOptionsManager.cs (1)
19public AntiforgeryOptions Value { get; set; } = new AntiforgeryOptions();
Microsoft.AspNetCore.Identity.Test (1)
PasswordHasherTest.cs (1)
207public PasswordHasherOptions Value { get; } = new PasswordHasherOptions();
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelStateDictionaryTest.cs (1)
1763public MvcOptions Value { get; } = new MvcOptions();
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\EmptyModelMetadataProvider.cs (1)
28public MvcOptions Value { get; } = new MvcOptions();
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
TestMvcOptions.cs (1)
50public MvcOptions Value { get; }
Microsoft.AspNetCore.ResponseCompression (2)
BrotliCompressionProviderOptions.cs (1)
20BrotliCompressionProviderOptions IOptions<BrotliCompressionProviderOptions>.Value => this;
GzipCompressionProviderOptions.cs (1)
20GzipCompressionProviderOptions IOptions<GzipCompressionProviderOptions>.Value => this;
Microsoft.Extensions.Caching.Hybrid.Tests (1)
L2Tests.cs (1)
31T IOptions<T>.Value => value;
Microsoft.Extensions.Caching.Memory (1)
MemoryCacheOptions.cs (1)
101MemoryCacheOptions IOptions<MemoryCacheOptions>.Value
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCacheOptions.cs (1)
46SqlServerCacheOptions IOptions<SqlServerCacheOptions>.Value
Microsoft.Extensions.Caching.SqlServer.Tests (1)
TestOptions.cs (1)
17public SqlServerCacheOptions Value
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCacheOptions.cs (1)
45RedisCacheOptions IOptions<RedisCacheOptions>.Value
Microsoft.Extensions.Options (3)
OptionsManager.cs (1)
33public TOptions Value => Get(Options.DefaultName);
OptionsWrapper.cs (1)
28public TOptions Value { get; }
UnnamedOptionsManager.cs (1)
19public TOptions Value
771 references to Value
Aspire.Dashboard (4)
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)
62Options = dashboardOptions.Value.TelemetryLimits
ResourceService\DashboardClient.cs (1)
84_dashboardOptions = dashboardOptions.Value;
Aspire.Dashboard.Tests (6)
Integration\StartupTests.cs (6)
499Assert.Single(options.Value.Rules.Where(r => r.CategoryName == null && r.LogLevel == LogLevel.Trace)); 500Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Grpc" && r.LogLevel == LogLevel.Trace)); 501Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Microsoft.Hosting.Lifetime" && r.LogLevel == LogLevel.Trace)); 538Assert.Single(options.Value.Rules.Where(r => r.CategoryName == null && r.LogLevel == LogLevel.Trace)); 539Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Grpc" && r.LogLevel == LogLevel.Trace)); 540Assert.Single(options.Value.Rules.Where(r => r.CategoryName == "Microsoft.Hosting.Lifetime" && r.LogLevel == LogLevel.Trace));
Aspire.Hosting (4)
Dcp\DcpDependencyCheck.cs (1)
27_dcpOptions = dcpOptions.Value;
Dcp\DcpHostService.cs (1)
53_dcpOptions = dcpOptions.Value;
Dcp\DcpNameGenerator.cs (2)
72return (GetObjectNameForResource(container, _options.Value, nameSuffix), nameSuffix); 78return (GetObjectNameForResource(project, _options.Value, nameSuffix), nameSuffix);
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
32_options = options.Value;
Aspire.Hosting.Tests (20)
Dcp\DcpCliArgsTests.cs (1)
55var dcpOptions = app.Services.GetRequiredService<IOptions<DcpOptions>>().Value;
DistributedApplicationBuilderTests.cs (6)
48Assert.Null(options.Value.Publisher); 49Assert.Null(options.Value.OutputPath); 71Assert.Equal("manifest", publishOptions.Value.Publisher); 72Assert.Equal("/tmp/", publishOptions.Value.OutputPath); 84Assert.Equal("docker", publishOptions.Value.Publisher); 85Assert.Equal("/path/", publishOptions.Value.OutputPath);
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;
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)
19_jsonOutputFormatter = mvcOptions.Value.OutputFormatters.OfType<NewtonsoftJsonOutputFormatter>().First(); 64foreach (var formatter in _mvcOptions.Value.OutputFormatters) 77foreach (var formatter in optionsAccessor.Value.OutputFormatters)
CreateDefaultBuilderOfTApp (1)
Program.cs (1)
38var hosts = string.Join(',', hostFilteringOptions.Value.AllowedHosts);
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
IIS.LongTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
KeyManagementSimulator (1)
Program.cs (1)
353keyManagementOptions.Value.AuthenticatedEncryptorFactories.Add(authenticatedEncryptorFactory);
Microsoft.AspNetCore.Antiforgery (3)
Internal\AntiforgeryOptionsSetup.cs (1)
18_dataProtectionOptions = dataProtectionOptions.Value;
Internal\DefaultAntiforgery.cs (1)
32_options = antiforgeryOptionsAccessor.Value;
Internal\DefaultAntiforgeryTokenStore.cs (1)
19_options = optionsAccessor.Value;
Microsoft.AspNetCore.Antiforgery.Test (2)
AntiforgeryOptionsSetupTest.cs (2)
31var cookieName = options.Value.Cookie.Name; 56var cookieName = options.Value.Cookie.Name;
Microsoft.AspNetCore.Authentication (1)
AuthenticationBuilder.cs (1)
119_authOptions = authOptions.Value;
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenHandler.cs (1)
87?.Value?.SerializerOptions?.GetTypeInfo(typeof(AccessTokenResponse)) as JsonTypeInfo<AccessTokenResponse>;
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateValidationCache.cs (1)
23_options = options.Value;
Microsoft.AspNetCore.Authentication.Core (2)
AuthenticationSchemeProvider.cs (1)
33_options = options.Value;
AuthenticationService.cs (1)
30Options = options.Value;
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)
29_options = options.Value;
DefaultAuthorizationService.cs (1)
44_options = options.Value;
PassThroughAuthorizationHandler.cs (1)
29=> _options = options.Value;
Microsoft.AspNetCore.Authorization.Test (6)
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;
Microsoft.AspNetCore.Components (2)
Routing\RouteTableFactory.cs (1)
121routeOptions.Value.SetParameterPolicy("regex", typeof(RegexInlineRouteConstraint));
src\Http\Routing\src\DefaultInlineConstraintResolver.cs (1)
36_inlineConstraintMap = routeOptions.Value.TrimmerSafeConstraintMap;
Microsoft.AspNetCore.Components.Endpoints (4)
Builder\OpaqueRedirection.cs (1)
46var lifetime = options.Value.TemporaryRedirectionUrlValidityDuration;
FormMapping\HttpContextFormValueMapper.cs (1)
28_options = options.Value._formMappingOptions;
Rendering\EndpointHtmlRenderer.cs (1)
56_options = serviceProvider.GetRequiredService<IOptions<RazorComponentsServiceOptions>>().Value;
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
208var showDetailedErrors = env.IsDevelopment() || options.Value.DetailedErrors;
Microsoft.AspNetCore.Components.Server (6)
CircuitJavaScriptInitializationMiddleware.cs (1)
18_initializers = options.Value.JavaScriptInitializers;
Circuits\CircuitFactory.cs (1)
33_options = options.Value;
Circuits\CircuitRegistry.cs (1)
51_options = options.Value;
Circuits\RemoteErrorBoundaryLogger.cs (1)
21_options = options.Value;
Circuits\RemoteJSRuntime.cs (2)
45_options = circuitOptions.Value; 46_maximumIncomingBytes = componentHubOptions.Value.MaximumReceiveMessageSize ?? long.MaxValue;
Microsoft.AspNetCore.Components.Server.Tests (7)
Circuits\RemoteJSRuntimeTest.cs (1)
103componentHubOptions.Value.MaximumReceiveMessageSize = componentHubMaximumIncomingBytes;
DependencyInjection\ComponentServiceCollectionExtensionsTest.cs (6)
24var protocol = Assert.Single(options.Value.SupportedProtocols); 45var protocol = Assert.Single(options.Value.SupportedProtocols); 47Assert.Equal(TimeSpan.FromMinutes(10), options.Value.HandshakeTimeout); 72var protocol = Assert.Single(options.Value.SupportedProtocols); 74Assert.Equal(TimeSpan.FromMinutes(5), options.Value.HandshakeTimeout); 77Assert.Equal(TimeSpan.FromMinutes(10), globalOptions.Value.HandshakeTimeout);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
AuthenticationStateSerializer.cs (1)
24_serializeCallback = options.Value.SerializationCallback;
Microsoft.AspNetCore.ConcurrencyLimiter (3)
ConcurrencyLimiterMiddleware.cs (2)
30if (options.Value.OnRejected == null) 37_onRejected = options.Value.OnRejected;
QueuePolicies\BasePolicy.cs (1)
21var queuePolicyOptions = options.Value;
Microsoft.AspNetCore.CookiePolicy (2)
CookiePolicyMiddleware.cs (2)
37Options = options.Value; 49Options = options.Value;
Microsoft.AspNetCore.Cors (2)
Infrastructure\CorsService.cs (1)
32_options = options.Value;
Infrastructure\DefaultCorsPolicyProvider.cs (1)
21_options = options.Value;
Microsoft.AspNetCore.DataProtection (11)
DataProtectionServiceCollectionExtensions.cs (2)
92if (!string.IsNullOrEmpty(dpOptions.Value.ApplicationDiscriminator)) 94dataProtectionProvider = dataProtectionProvider.CreateProtector(dpOptions.Value.ApplicationDiscriminator);
KeyManagement\DefaultKeyResolver.cs (2)
64_maxDecryptRetries = GetMaxDecryptRetriesFromAppContext() ?? keyManagementOptions.Value.MaximumTotalDefaultKeyResolverRetries; 65_decryptRetryDelay = keyManagementOptions.Value.DefaultKeyResolverRetryDelay;
KeyManagement\KeyRingProvider.cs (1)
50var options = keyManagementOptions.Value ?? new();
KeyManagement\XmlKeyManager.cs (5)
98var keyRepository = keyManagementOptions.Value.XmlRepository; 99var keyEncryptor = keyManagementOptions.Value.XmlEncryptor; 113_authenticatedEncryptorConfiguration = keyManagementOptions.Value.AuthenticatedEncryptorConfiguration!; 115var escrowSinks = keyManagementOptions.Value.KeyEscrowSinks; 122_encryptorFactories = keyManagementOptions.Value.AuthenticatedEncryptorFactories;
XmlEncryption\EncryptedXmlDecryptor.cs (1)
40_options = services?.GetService<IOptions<XmlKeyDecryptionOptions>>()?.Value;
Microsoft.AspNetCore.DataProtection.Tests (5)
KeyManagement\XmlKeyManagerTests.cs (3)
107options.Value.AuthenticatedEncryptorFactories.Add(testEncryptorFactory); 205options.Value.AuthenticatedEncryptorFactories.Add(testEncryptorFactory); 206options.Value.KeyEscrowSinks.Add(mockKeyEscrow.Object);
ServiceCollectionTests.cs (2)
88var options = services.GetRequiredService<IOptions<KeyManagementOptions>>().Value; 121var options = services.GetRequiredService<IOptions<KeyManagementOptions>>().Value;
Microsoft.AspNetCore.Diagnostics (8)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
61_options = options.Value; 68_serializationContext = CreateSerializationContext(jsonOptions?.Value);
ExceptionHandler\ExceptionHandlerExtensions.cs (3)
128if (!string.IsNullOrEmpty(options.Value.ExceptionHandlingPath) && options.Value.ExceptionHandler is null) 132options.Value.ExceptionHandler = newNext;
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
43_options = options.Value;
StatusCodePage\StatusCodePagesMiddleware.cs (1)
27_options = options.Value;
WelcomePage\WelcomePageMiddleware.cs (1)
30_options = options.Value;
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (3)
DatabaseDeveloperPageExceptionFilter.cs (1)
38_options = options?.Value ?? throw new ArgumentNullException(nameof(options));
DatabaseErrorPageMiddleware.cs (1)
62_options = options.Value;
MigrationsEndPointMiddleware.cs (1)
42_options = options.Value;
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckMiddleware.cs (1)
32_healthCheckOptions = healthCheckOptions.Value;
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Latency\RequestLatencyTelemetryMiddleware.cs (2)
41_exportTimeout = options.Value.LatencyDataExportTimeout; 48_applicationName = appMetdata.Value.ApplicationName;
Logging\HttpLoggingRedactionInterceptor.cs (1)
46var optionsValue = options.Value;
Logging\RequestHeadersLogEnricher.cs (1)
35var opt = Throw.IfMemberNull(options, options.Value);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Latency\RequestLatencyTelemetryExtensionsTests.cs (1)
64Assert.True(actualOptions.Value.LatencyDataExportTimeout == expectedOptions.LatencyDataExportTimeout);
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 (1)
14mock.Setup(o => o.Value).Returns(options);
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerMiddlewareTest.cs (1)
501var optionsAccessor = Mock.Of<IOptions<ExceptionHandlerOptions>>(o => o.Value == options);
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\Binding\JsonTranscodingServiceMethodProvider.cs (3)
33_globalOptions = globalOptions.Value; 34_serviceOptions = serviceOptions.Value; 35_jsonTranscodingOptions = jsonTranscodingOptions.Value;
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)
24_options = options.Value;
Microsoft.AspNetCore.HeaderParsing.Tests (7)
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)
121_options.Value.DefaultValues.Add("Date", date);
HeaderRegistryTests.cs (2)
42_options.Value.DefaultValues.Add("Date", date); 57_options.Value.DefaultValues.Add("Date", date);
Microsoft.AspNetCore.HeaderPropagation (3)
DependencyInjection\HeaderPropagationHttpClientBuilderExtensions.cs (2)
32for (var i = 0; i < middlewareOptions.Value.Headers.Count; i++) 34var header = middlewareOptions.Value.Headers[i];
HeaderPropagationMiddleware.cs (1)
35_options = options.Value;
Microsoft.AspNetCore.Hosting (2)
GenericHost\GenericWebHostService.cs (1)
32Options = options.Value;
Http\DefaultHttpContextFactory.cs (1)
33_formOptions = serviceProvider.GetRequiredService<IOptions<FormOptions>>().Value;
Microsoft.AspNetCore.Hosting.Tests (2)
StartupManagerTests.cs (2)
353var options = app.ApplicationServices.GetRequiredService<IOptions<FakeOptions>>().Value; 400var options = app.ApplicationServices.GetRequiredService<IOptions<FakeOptions>>().Value;
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionManager.cs (1)
35_disconnectTimeout = connectionOptions.Value.DisconnectTimeout ?? ConnectionOptionsSetup.DefaultDisconectTimeout;
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnectionFactory.cs (1)
32_httpConnectionOptions = options.Value;
Microsoft.AspNetCore.Http.Extensions (5)
DefaultProblemDetailsWriter.cs (2)
22_options = options.Value; 23_serializerOptions = jsonOptions.Value.SerializerOptions;
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 (31)
ProblemDetailsServiceCollectionExtensionsTest.cs (31)
100Assert.NotNull(jsonOptions.Value); 101Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 102Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 103Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 125Assert.Throws<InvalidOperationException>(() => jsonOptions.Value); 165Assert.NotNull(jsonOptions.Value); 166Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 167Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 168Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 186Assert.NotNull(jsonOptions.Value); 187Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 188Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 206Assert.NotNull(jsonOptions.Value); 207Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 208Assert.IsNotType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 209Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 210Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 231Assert.NotNull(jsonOptions.Value); 232Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 234Assert.Equal(3, jsonOptions.Value.SerializerOptions.TypeInfoResolverChain.Count); 235Assert.IsType<CustomProblemDetailsTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[0]); 236Assert.Equal("Microsoft.AspNetCore.Http.ProblemDetailsJsonContext", jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[1].GetType().FullName); 237Assert.IsType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[2]); 239var pdTypeInfo = jsonOptions.Value.SerializerOptions.GetTypeInfo(typeof(ProblemDetails));
Microsoft.AspNetCore.Http.Results (1)
HttpResultsHelper.cs (1)
153return httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
Microsoft.AspNetCore.HttpOverrides (11)
CertificateForwardingMiddleware.cs (1)
37_options = options.Value;
ForwardedHeadersMiddleware.cs (9)
53ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.ForwardedForHeaderName); 54ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.ForwardedHostHeaderName); 55ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.ForwardedProtoHeaderName); 56ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.ForwardedPrefixHeaderName); 57ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.OriginalForHeaderName); 58ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.OriginalHostHeaderName); 59ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.OriginalProtoHeaderName); 60ArgumentException.ThrowIfNullOrWhiteSpace(options.Value.OriginalPrefixHeaderName); 62_options = options.Value;
HttpMethodOverrideMiddleware.cs (1)
29_options = options.Value;
Microsoft.AspNetCore.HttpOverrides.Tests (2)
CertificateForwardingTest.cs (2)
24Assert.Throws<OptionsValidationException>(() => options.Value); 34Assert.Throws<OptionsValidationException>(() => options.Value);
Microsoft.AspNetCore.HttpsPolicy (2)
HstsMiddleware.cs (1)
39var hstsOptions = options.Value;
HttpsRedirectionMiddleware.cs (1)
45var httpsRedirectionOptions = options.Value;
Microsoft.AspNetCore.Identity (4)
DataProtectorTokenProvider.cs (1)
30Options = options?.Value ?? new DataProtectionTokenProviderOptions();
SecurityStampValidator.cs (2)
32Options = options.Value; 49Options = options.Value;
SignInManager.cs (1)
55Options = optionsAccessor?.Value ?? new IdentityOptions();
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
IdentityUserContext.cs (1)
107?.Value?.Stores;
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
39options.Setup(o => o.Value).Returns(idOptions);
Microsoft.AspNetCore.Identity.InMemory.Test (1)
src\Identity\test\Shared\MockHelpers.cs (1)
39options.Setup(o => o.Value).Returns(idOptions);
Microsoft.AspNetCore.Identity.Test (21)
IdentityBuilderTest.cs (1)
246var tokenProviders = provider.GetRequiredService<IOptions<IdentityOptions>>().Value.Tokens.ProviderMap.Values;
IdentityOptionsTest.cs (2)
48var myOptions = optionsGetter.Value; 67var myOptions = optionsGetter.Value;
SecurityStampValidatorTest.cs (12)
100identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 102options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 163identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 165options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 203identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 206options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero }); 242identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 245options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.FromDays(1) }); 279identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 282options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.FromMinutes(1), TimeProvider = timeProvider }); 328identityOptions.Setup(a => a.Value).Returns(new IdentityOptions()); 330options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.Zero });
SignInManagerTest.cs (3)
45options.Setup(a => a.Value).Returns(identityOptions); 75options.Setup(a => a.Value).Returns(identityOptions); 107options.Setup(a => a.Value).Returns(identityOptions);
src\Identity\test\Shared\MockHelpers.cs (1)
39options.Setup(o => o.Value).Returns(idOptions);
UserClaimsPrincipalFactoryTest.cs (2)
21options.Setup(a => a.Value).Returns(identityOptions); 82options.Setup(a => a.Value).Returns(identityOptions);
Microsoft.AspNetCore.Localization (1)
RequestLocalizationMiddleware.cs (1)
39_options = options.Value;
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
51_mvcOptions = optionsAccessor.Value; 55_routeOptions = routeOptions.Value;
Microsoft.AspNetCore.Mvc.Core (40)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
21var options = apiBehaviorOptions.Value;
ApplicationModels\ApplicationModelFactory.cs (1)
30_conventions = options.Value.Conventions;
ApplicationModels\AuthorizationApplicationModelProvider.cs (1)
21_mvcOptions = mvcOptions.Value;
ApplicationModels\DefaultApplicationModelProvider.cs (1)
31_mvcOptions = mvcOptionsAccessor.Value;
Builder\MvcApplicationBuilderExtensions.cs (1)
70if (options.Value.EnableEndpointRouting)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (2)
211var options = s.GetRequiredService<IOptions<MvcOptions>>().Value; 217var options = s.GetRequiredService<IOptions<MvcOptions>>().Value;
Formatters\FormatFilter.cs (1)
32_options = options.Value;
Infrastructure\ConfigureCompatibilityOptions.cs (1)
34Version = compatibilityOptions.Value.CompatibilityVersion;
Infrastructure\ControllerActionInvokerCache.cs (1)
37_mvcOptions = mvcOptions.Value;
Infrastructure\ControllerActionInvokerProvider.cs (4)
47_valueProviderFactories = optionsAccessor.Value.ValueProviderFactories.ToArray(); 48_maxModelValidationErrors = optionsAccessor.Value.MaxModelValidationErrors; 49_maxValidationDepth = optionsAccessor.Value.MaxValidationDepth; 50_maxModelBindingRecursionDepth = optionsAccessor.Value.MaxModelBindingRecursionDepth;
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
32_apiBehaviorOptions = apiBehaviorOptions.Value;
Infrastructure\DefaultOutputFormatterSelector.cs (3)
44_formatters = new ReadOnlyCollection<IOutputFormatter>(options.Value.OutputFormatters); 45_respectBrowserAcceptHeader = options.Value.RespectBrowserAcceptHeader; 46_returnHttpNotAcceptable = options.Value.ReturnHttpNotAcceptable;
Infrastructure\DefaultProblemDetailsFactory.cs (2)
32_options = options?.Value ?? throw new ArgumentNullException(nameof(options)); 33_configure = problemDetailsOptions?.Value?.CustomizeProblemDetails;
Infrastructure\ModelStateInvalidFilterFactory.cs (1)
24return new ModelStateInvalidFilter(options.Value, loggerFactory.CreateLogger(typeof(ModelStateInvalidFilter)));
Infrastructure\MvcCoreMvcOptionsSetup.cs (2)
71options.InputFormatters.Add(new SystemTextJsonInputFormatter(_jsonOptions.Value, _loggerFactory.CreateLogger<SystemTextJsonInputFormatter>())); 81var jsonOutputFormatter = SystemTextJsonOutputFormatter.CreateFormatter(_jsonOptions.Value);
Infrastructure\SystemTextJsonResultExecutor.cs (1)
30_options = options.Value;
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 (1)
238bindingContext.MaxModelBindingRecursionDepth = mvcOptions.Value.MaxModelBindingRecursionDepth;
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
147return optionsAccessor.Value.ModelBindingMessageProvider;
ModelBinding\ModelBinderFactory.cs (1)
41_providers = options.Value.ModelBinderProviders.ToArray();
RequireHttpsAttribute.cs (4)
77if (optionsAccessor.Value.SslPort.HasValue && optionsAccessor.Value.SslPort > 0) 80host = new HostString(host.Host, optionsAccessor.Value.SslPort.Value); 88var permanentValue = _permanent ?? optionsAccessor.Value.RequireHttpsPermanent;
ResponseCacheAttribute.cs (1)
124var cacheProfile = GetCacheProfile(optionsAccessor.Value);
Routing\ControllerRequestDelegateFactory.cs (5)
49_valueProviderFactories = optionsAccessor.Value.ValueProviderFactories.ToArray(); 50_maxModelValidationErrors = optionsAccessor.Value.MaxModelValidationErrors; 51_maxValidationDepth = optionsAccessor.Value.MaxValidationDepth; 52_maxModelBindingRecursionDepth = optionsAccessor.Value.MaxModelBindingRecursionDepth; 53_enableActionInvokers = optionsAccessor.Value.EnableActionInvokers;
Microsoft.AspNetCore.Mvc.Core.Test (55)
AcceptedAtActionResultTests.cs (1)
269options.Value.OutputFormatters.Add(formatter.Object);
AcceptedAtRouteResultTests.cs (1)
177options.Value.OutputFormatters.Add(formatter.Object);
AcceptedResultTests.cs (1)
134options.Value.OutputFormatters.Add(formatter.Object);
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (3)
77options.Value.AddPolicy("Base", policy => policy.RequireClaim("Basic").RequireClaim("Basic2")); 78options.Value.AddPolicy("Derived", policy => policy.RequireClaim("Derived")); 131authOptions.Value.AddPolicy("Base", authorizationPolicy);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (4)
1151options.Value.Conventions.Add(applicationConvention.Object); 1172ApplicationModelConventions.ApplyConventions(applicationModel, options.Value.Conventions); 1333options.Value.Filters.Add(filter); 1368options.Value.Conventions.Add(convention);
CreatedAtActionResultTests.cs (2)
87options.Value.OutputFormatters.Add(new StringOutputFormatter()); 88options.Value.OutputFormatters.Add(SystemTextJsonOutputFormatter.CreateFormatter(new JsonOptions()));
CreatedAtRouteResultTests.cs (2)
101options.Value.OutputFormatters.Add(new StringOutputFormatter()); 102options.Value.OutputFormatters.Add(SystemTextJsonOutputFormatter.CreateFormatter(new JsonOptions()));
CreatedResultTests.cs (2)
134options.Value.OutputFormatters.Add(new StringOutputFormatter()); 135options.Value.OutputFormatters.Add(SystemTextJsonOutputFormatter.CreateFormatter(new JsonOptions()));
DependencyInjection\MvcBuilderExtensionsTest.cs (1)
156.Value;
DependencyInjection\MvcCoreBuilderExtensionsTest.cs (1)
99.Value;
Filters\MiddlewareFilterTest.cs (1)
267.SetupGet(o => o.Value)
Formatters\FormatFilterTest.cs (1)
460MvcOptions = OptionsManager.Value;
HttpNotFoundObjectResultTest.cs (2)
67options.Value.OutputFormatters.Add(new StringOutputFormatter()); 68options.Value.OutputFormatters.Add(SystemTextJsonOutputFormatter.CreateFormatter(new JsonOptions()));
HttpOkObjectResultTest.cs (2)
69options.Value.OutputFormatters.Add(new StringOutputFormatter()); 70options.Value.OutputFormatters.Add(SystemTextJsonOutputFormatter.CreateFormatter(new JsonOptions()));
Infrastructure\ControllerActionInvokerTest.cs (1)
1731options.Value.OutputFormatters.Add(formatter.Object);
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
230mvcOptions.Value.OutputFormatters.Add(formatter);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (3)
1088setup.Configure(options.Value); 1090configureOptions?.Invoke(options.Value); 1092var factory = TestModelBinderFactory.Create(options.Value.ModelBinderProviders.ToArray());
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (5)
1250setup.Configure(options.Value); 1252var lastIndex = options.Value.ModelBinderProviders.Count - 1; 1253options.Value.ModelBinderProviders.RemoveType<ComplexObjectModelBinderProvider>(); 1254options.Value.ModelBinderProviders.Add(new TestableComplexTypeModelBinderProvider()); 1256var factory = TestModelBinderFactory.Create(options.Value.ModelBinderProviders.ToArray());
ModelBinding\Binders\HeaderModelBinderProviderTest.cs (1)
181var options = context.Services.GetRequiredService<IOptions<MvcOptions>>().Value;
ModelBinding\ModelBinderFactoryTest.cs (16)
44options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(_ => null)); 70options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 110options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 145options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 186options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 224options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 255options.Value.ModelBinderProviders.Add(new TestModelBinderProvider(c => 370options.Value.ModelBinderProviders.Insert(0, modelBinderProvider); 425options.Value.ModelBinderProviders.Add(widgetProvider); 426options.Value.ModelBinderProviders.Add(widgetIdProvider); 487options.Value.ModelBinderProviders.Add(widgetProvider); 488options.Value.ModelBinderProviders.Add(widgetIdProvider); 541options.Value.ModelBinderProviders.Add(widgetProvider); 542options.Value.ModelBinderProviders.Add(widgetIdProvider); 605options.Value.ModelBinderProviders.Add(widgetProvider); 606options.Value.ModelBinderProviders.Add(widgetIdProvider);
RequireHttpsAttributeTests.cs (2)
236options.Value.SslPort = sslPort; 237options.Value.RequireHttpsPermanent = requireHttpsPermanent;
ResponseCacheAttributeTest.cs (1)
331optionsAccessor.Value.CacheProfiles.Add(p.Key, p.Value);
Routing\AttributeRoutingTest.cs (1)
168.SetupGet(o => o.Value)
Microsoft.AspNetCore.Mvc.Core.TestCommon (5)
TestModelBinderFactory.cs (3)
39options.Value.ModelBinderProviders.Add(provider); 61options.Value.ModelBinderProviders.Add(provider); 63new MvcCoreMvcOptionsSetup(new TestHttpRequestStreamReaderFactory()).Configure(options.Value);
TestModelMetadataProvider.cs (1)
19localizationOptions.Value.DataAnnotationLocalizerProvider = (modelType, localizerFactory) => localizerFactory.Create(modelType);
TestModelValidatorProvider.cs (1)
16options.Value.DataAnnotationLocalizerProvider = (modelType, localizerFactory) => localizerFactory.Create(modelType);
Microsoft.AspNetCore.Mvc.Cors (1)
CorsApplicationModelProvider.cs (1)
18_mvcOptions = mvcOptions.Value;
Microsoft.AspNetCore.Mvc.DataAnnotations (5)
DataAnnotationsClientModelValidatorProvider.cs (2)
49if (_options.Value.DataAnnotationLocalizerProvider != null && _stringLocalizerFactory != null) 53stringLocalizer = _options.Value.DataAnnotationLocalizerProvider(
DataAnnotationsMetadataProvider.cs (1)
37_localizationOptions = localizationOptions.Value;
DataAnnotationsModelValidatorProvider.cs (2)
47if (_stringLocalizerFactory != null && _options.Value.DataAnnotationLocalizerProvider != null) 49stringLocalizer = _options.Value.DataAnnotationLocalizerProvider(
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 (5)
AntiforgeryMiddlewareTest.cs (4)
41request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 125request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 157request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 189request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken);
SimpleWithWebApplicationBuilderTests.cs (1)
269Client.DefaultRequestHeaders.Add("Cookie", new CookieHeaderValue(antiforgeryOptions.Value.Cookie.Name, tokens.CookieToken).ToString());
Microsoft.AspNetCore.Mvc.IntegrationTests (15)
BodyValidationIntegrationTests.cs (2)
453var options = testContext.GetService<IOptions<MvcNewtonsoftJsonOptions>>().Value; 559var options = testContext.GetService<IOptions<MvcNewtonsoftJsonOptions>>().Value;
HasValidatorsValidationMetadataProviderIntegrationTest.cs (2)
27Assert.IsType<HasValidatorsValidationMetadataProvider>(options.Value.ModelMetadataDetailsProviders.Last()); 45Assert.IsType<HasValidatorsValidationMetadataProvider>(options.Value.ModelMetadataDetailsProviders.Last());
ModelBindingTestHelper.cs (8)
38MvcOptions = options.Value, 40ValueProviderFactories = new List<IValueProviderFactory>(options.Value.ValueProviderFactories), 78options.Value), 94options.Value.ModelBinderProviders.Insert(0, binderProvider); 100options.Value); 131options?.Value ?? new MvcOptions()); 142return options.Value.ModelValidatorProviders; 178return TestModelMetadataProvider.CreateProvider(optionsAccessor.Value.ModelMetadataDetailsProviders);
ParameterBinderExtensions.cs (1)
22Assert.NotNull(optionsAccessor?.Value); // Guard
TryValidateModelIntegrationTest.cs (1)
214optionsConfigurator.Invoke(options.Value);
ValidationIntegrationTests.cs (1)
2518var options = services.GetRequiredService<IOptions<MvcOptions>>().Value;
Microsoft.AspNetCore.Mvc.Localization.Test (4)
MvcLocalizationMvcBuilderExtensionsTest.cs (2)
98Assert.Equal("TestResources", actualOptions.Value.ResourcesPath); 122Assert.Same(dataAnnotationLocalizerProvider, actualOptions.Value.DataAnnotationLocalizerProvider);
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (2)
98Assert.Equal("TestResources", actualOptions.Value.ResourcesPath); 122Assert.Same(dataAnnotationLocalizerProvider, actualOptions.Value.DataAnnotationLocalizerProvider);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (5)
DependencyInjection\NewtonsoftJsonMvcOptionsSetup.cs (1)
39_jsonOptions = jsonOptions.Value;
NewtonsoftJsonHelper.cs (1)
35_defaultSettingsJsonSerializer = CreateHtmlSafeSerializer(options.Value.SerializerSettings);
NewtonsoftJsonOutputFormatter.cs (1)
140_jsonOptions ??= context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value;
NewtonsoftJsonResultExecutor.cs (2)
56_mvcOptions = mvcOptions?.Value ?? throw new ArgumentNullException(nameof(mvcOptions)); 57_jsonOptions = jsonOptions.Value;
Microsoft.AspNetCore.Mvc.Razor (1)
RazorViewEngine.cs (1)
57_options = optionsAccessor.Value;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
PageActionDescriptorChangeProvider.cs (1)
31var rootDirectory = razorPagesOptions.Value.RootDirectory;
RazorProjectPageRouteModelProvider.cs (1)
27_pagesOptions = pagesOptionsAccessor.Value;
RazorReferenceManager.cs (1)
27_options = options.Value;
RuntimeCompilationFileProvider.cs (1)
18_options = options.Value;
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorViewEngineOptionsTest.cs (2)
37var formats = accessor.Value.AreaViewLocationFormats; 67var formats = accessor.Value.ViewLocationFormats;
RazorViewEngineTest.cs (1)
2113.SetupGet(v => v.Value)
Microsoft.AspNetCore.Mvc.RazorPages (17)
ApplicationModels\AuthorizationPageApplicationModelProvider.cs (1)
21_mvcOptions = mvcOptions.Value;
ApplicationModels\CompiledPageRouteModelProvider.cs (1)
30_pagesOptions = pagesOptionsAccessor?.Value ?? throw new ArgumentNullException(nameof(pagesOptionsAccessor));
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
32_razorPagesOptions = razorPagesOptions.Value;
ApplicationModels\PageConventionCollection.cs (1)
47_mvcOptions ??= _serviceProvider!.GetRequiredService<IOptions<MvcOptions>>().Value;
ApplicationModels\ResponseCacheFilterApplicationModelProvider.cs (1)
20_mvcOptions = mvcOptionsAccessor.Value;
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
18_pagesOptions = pagesOptions?.Value ?? throw new ArgumentNullException(nameof(pagesOptions));
Infrastructure\CompiledPageActionDescriptorProvider.cs (2)
41_compiledPageActionDescriptorFactory = new CompiledPageActionDescriptorFactory(applicationModelProviders, mvcOptions.Value, pageOptions.Value);
Infrastructure\DefaultPageLoader.cs (2)
29_compiledPageActionDescriptorFactory = new CompiledPageActionDescriptorFactory(applicationModelProviders, mvcOptions.Value, pageOptions.Value);
Infrastructure\PageActionDescriptorProvider.cs (2)
34_mvcOptions = mvcOptionsAccessor.Value; 36_conventions = pagesOptionsAccessor.Value.Conventions
Infrastructure\PageActionInvokerProvider.cs (2)
45_valueProviderFactories = mvcOptions.Value.ValueProviderFactories.ToArray(); 48_mvcViewOptions = mvcViewOptions.Value;
Infrastructure\PageRequestDelegateFactory.cs (3)
59_valueProviderFactories = mvcOptions.Value.ValueProviderFactories.ToArray(); 62_mvcViewOptions = mvcViewOptions.Value; 63_enableActionInvokers = mvcOptions.Value.EnableActionInvokers;
Microsoft.AspNetCore.Mvc.RazorPages.Test (5)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (2)
111options.Value.AddPolicy("Base", policy => policy.RequireClaim("Basic").RequireClaim("Basic2")); 112options.Value.AddPolicy("Derived", policy => policy.RequireClaim("Derived"));
ApplicationModels\ResponseCacheFilterApplicationModelProviderTest.cs (1)
99options.Value.CacheProfiles.Add("TestCacheProfile", new CacheProfile
DependencyInjection\MvcRazorPagesMvcBuilderExtensionsTest.cs (1)
32var conventions = accessor.Value.Conventions;
Infrastructure\PageActionDescriptorProviderTest.cs (1)
365accessor.SetupGet(a => a.Value).Returns(options ?? new TOptions());
Microsoft.AspNetCore.Mvc.TagHelpers (1)
CacheTagHelperMemoryCacheFactory.cs (1)
23SizeLimit = options.Value.SizeLimit,
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
TestableHtmlGenerator.cs (1)
123.SetupGet(options => options.Value)
Microsoft.AspNetCore.Mvc.Test (1)
MvcOptionsSetupTest.cs (1)
281return serviceProvider.GetRequiredService<IOptions<T>>().Value;
Microsoft.AspNetCore.Mvc.ViewFeatures (9)
CookieTempDataProvider.cs (1)
48_options = options.Value;
DefaultHtmlGenerator.cs (2)
75_formInputRenderMode = optionsAccessor.Value.HtmlHelperOptions.FormInputRenderMode; 78IdAttributeDotReplacement = optionsAccessor.Value.HtmlHelperOptions.IdAttributeDotReplacement;
DefaultValidationHtmlAttributeProvider.cs (1)
39var clientValidatorProviders = optionsAccessor.Value.ClientModelValidatorProviders;
RemoteAttributeBase.cs (1)
183var provider = options.Value.DataAnnotationLocalizerProvider;
Rendering\SystemTextJsonHelper.cs (1)
17_htmlSafeJsonSerializerOptions = GetHtmlSafeSerializerOptions(options.Value.JsonSerializerOptions);
ViewComponentResultExecutor.cs (1)
58_htmlHelperOptions = mvcHelperOptions.Value.HtmlHelperOptions;
ViewEngines\CompositeViewEngine.cs (1)
21ViewEngines = optionsAccessor.Value.ViewEngines.ToArray();
ViewExecutor.cs (1)
51ViewOptions = viewOptions.Value;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (35)
CookieTempDataProviderTest.cs (1)
401testOptions.SetupGet(o => o.Value).Returns(options);
DefaultHtmlGeneratorTest.cs (1)
1005mvcViewOptionsAccessor.SetupGet(accessor => accessor.Value).Returns(options ?? new MvcViewOptions());
DefaultValidationHtmlAttributeProviderTest.cs (1)
275mvcViewOptionsAccessor.SetupGet(accessor => accessor.Value).Returns(mvcViewOptions);
PartialViewResultExecutorTest.cs (1)
359options.Value.ViewEngines.Add(viewEngine.Object);
RemoteAttributeBaseTest.cs (4)
226options.Value.DataAnnotationLocalizerProvider = (type, factory) => localizer.Object; 272options.Value.DataAnnotationLocalizerProvider = (type, factory) => localizer.Object; 317options.Value.DataAnnotationLocalizerProvider = (type, factory) => localizer.Object; 409options.Value.DataAnnotationLocalizerProvider = (type, factory) => localizer.Object;
ViewEngines\CompositeViewEngineTest.cs (26)
21optionsAccessor.Value.ViewEngines.Add(viewEngine1); 22optionsAccessor.Value.ViewEngines.Add(viewEngine2); 59optionsAccessor.Value.ViewEngines.Add(engine.Object); 81optionsAccessor.Value.ViewEngines.Add(engine.Object); 113optionsAccessor.Value.ViewEngines.Add(engine1.Object); 114optionsAccessor.Value.ViewEngines.Add(engine2.Object); 115optionsAccessor.Value.ViewEngines.Add(engine3.Object); 146optionsAccessor.Value.ViewEngines.Add(engine1.Object); 147optionsAccessor.Value.ViewEngines.Add(engine2.Object); 148optionsAccessor.Value.ViewEngines.Add(engine3.Object); 191optionsAccessor.Value.ViewEngines.Add(engine.Object); 216optionsAccessor.Value.ViewEngines.Add(engine.Object); 251optionsAccessor.Value.ViewEngines.Add(engine1.Object); 252optionsAccessor.Value.ViewEngines.Add(engine2.Object); 253optionsAccessor.Value.ViewEngines.Add(engine3.Object); 287optionsAccessor.Value.ViewEngines.Add(engine1.Object); 288optionsAccessor.Value.ViewEngines.Add(engine2.Object); 289optionsAccessor.Value.ViewEngines.Add(engine3.Object); 326optionsAccessor.Value.ViewEngines.Add(engine.Object); 348optionsAccessor.Value.ViewEngines.Add(engine.Object); 380optionsAccessor.Value.ViewEngines.Add(engine1.Object); 381optionsAccessor.Value.ViewEngines.Add(engine2.Object); 382optionsAccessor.Value.ViewEngines.Add(engine3.Object); 413optionsAccessor.Value.ViewEngines.Add(engine1.Object); 414optionsAccessor.Value.ViewEngines.Add(engine2.Object); 415optionsAccessor.Value.ViewEngines.Add(engine3.Object);
ViewResultExecutorTest.cs (1)
349options.Value.ViewEngines.Add(viewEngine.Object);
Microsoft.AspNetCore.Mvc.Views.TestCommon (1)
HtmlGeneratorUtilities.cs (1)
31.SetupGet(o => o.Value)
Microsoft.AspNetCore.OutputCaching (5)
OutputCacheKeyProvider.cs (1)
29_options = options.Value;
OutputCacheMiddleware.cs (1)
68_options = options.Value;
OutputCacheServiceCollectionExtensions.cs (1)
36SizeLimit = outputCacheOptions.Value.SizeLimit
Policies\NamedPolicy.cs (1)
76var policies = _options!.Value.NamedPolicies;
Policies\TypedPolicy.cs (1)
34return _instance ??= ActivatorUtilities.CreateInstance(options.Value.ApplicationServices, _policyType) as IOutputCachePolicy;
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
75_options = optionsAccessor.Value;
Microsoft.AspNetCore.RateLimiting (5)
RateLimitingMiddleware.cs (5)
45_defaultOnRejected = options.Value.OnRejected; 46_rejectionStatusCode = options.Value.RejectionStatusCode; 47_policyMap = new Dictionary<string, DefaultRateLimiterPolicy>(options.Value.PolicyMap); 50foreach (var unactivatedPolicy in options.Value.UnactivatedPolicyMap) 55_globalLimiter = options.Value.GlobalLimiter;
Microsoft.AspNetCore.RateLimiting.Tests (39)
RateLimitingMetricsTests.cs (3)
31options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 71options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true)); 130options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true));
RateLimitingMiddlewareTests.cs (36)
22options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(); 65options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true)); 90options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 91options.Value.OnRejected = (context, token) => 115options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 116options.Value.OnRejected = (context, token) => 144options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 188options.Value.AddPolicy<string>(name, (context => 195options.Value.OnRejected = (context, token) => 223options.Value.AddFixedWindowLimiter(name, options => 231options.Value.OnRejected = (context, token) => 260options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey", 404, false)); 262options.Value.OnRejected = (context, token) => 291options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey", 404, true)); 293options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 294options.Value.OnRejected = (context, token) => 323options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey", 404, false)); 325options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(true)); 326options.Value.OnRejected = (context, token) => 355options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey", 404, false)); 357options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 358options.Value.OnRejected = (context, token) => 387options.Value.AddPolicy<string, TestRateLimiterPolicy>(name); 389options.Value.OnRejected = (context, token) => 432options.Value.AddPolicy<string>(endpointName1, new TestRateLimiterPolicy(duplicateKey, 404, false)); 433options.Value.AddPolicy<string>(endpointName2, new TestRateLimiterPolicy(duplicateKey, 400, false)); 435options.Value.OnRejected = (context, token) => 473options.Value.AddPolicy<string>(endpointName1, key => 480options.Value.AddPolicy<string>(endpointName2, key => 487options.Value.OnRejected = (context, token) => 522options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey", 404, false)); 524options.Value.GlobalLimiter = new TestPartitionedRateLimiter<HttpContext>(new TestRateLimiter(false)); 525options.Value.OnRejected = (context, token) => 561options.Value.OnRejected = (context, token) => 593options.Value.AddPolicy<string>(name, new TestRateLimiterPolicy("myKey2", 403, false)); 595options.Value.OnRejected = (context, token) =>
Microsoft.AspNetCore.RequestDecompression (1)
DefaultRequestDecompressionProvider.cs (1)
26_providers = options.Value.DecompressionProviders;
Microsoft.AspNetCore.ResponseCaching (3)
ResponseCachingKeyProvider.cs (1)
28_options = options.Value;
ResponseCachingMiddleware.cs (2)
51SizeLimit = options.Value.SizeLimit 73_options = options.Value;
Microsoft.AspNetCore.ResponseCompression (3)
BrotliCompressionProvider.cs (1)
22Options = options.Value;
GzipCompressionProvider.cs (1)
22Options = options.Value;
ResponseCompressionProvider.cs (1)
35var responseCompressionOptions = options.Value;
Microsoft.AspNetCore.Rewrite (2)
RewriteBuilderExtensions.cs (1)
61options.Value.BranchedNext = newNext;
RewriteMiddleware.cs (1)
42_options = options.Value;
Microsoft.AspNetCore.Routing (12)
Builder\EndpointRouteBuilderExtensions.cs (1)
459var throwOnBadRequest = routeHandlerOptions?.Value.ThrowOnBadRequest ?? false;
Builder\EndpointRoutingApplicationBuilderExtensions.cs (2)
107if (!routeOptions.Value.EndpointDataSources.Contains(dataSource)) 109routeOptions.Value.EndpointDataSources.Add(dataSource);
DefaultInlineConstraintResolver.cs (1)
36_inlineConstraintMap = routeOptions.Value.TrimmerSafeConstraintMap;
DefaultLinkGenerator.cs (3)
63AppendTrailingSlash = routeOptions.Value.AppendTrailingSlash, 64LowercaseQueryStrings = routeOptions.Value.LowercaseQueryStrings, 65LowercaseUrls = routeOptions.Value.LowercaseUrls,
DefaultParameterPolicyFactory.cs (1)
19_options = options.Value;
EndpointMiddleware.cs (1)
30_routeOptions = routeOptions?.Value ?? throw new ArgumentNullException(nameof(routeOptions));
EndpointRoutingMiddleware.cs (1)
51_routeOptions = routeOptions.Value;
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 (7)
MinimalFormTests.cs (7)
54request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 114request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 475request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 534request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 586request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 638request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken); 687request.Headers.Add("Cookie", antiforgeryOptions.Value.Cookie.Name + "=" + tokens.CookieToken);
Microsoft.AspNetCore.Routing.Tests (15)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (1)
324Assert.Equal(mockRouteBuilder.Object.DataSources, routeOptions.Value.EndpointDataSources);
DefaultInlineConstraintResolverTest.cs (1)
369optionsAccessor.SetupGet(o => o.Value).Returns(routeOptions);
LinkGeneratorTestBase.cs (1)
75new CompositeEndpointDataSource(routeOptions.Value.EndpointDataSources),
LinkParserTestBase.cs (1)
67new CompositeEndpointDataSource(routeOptions.Value.EndpointDataSources),
RouteCollectionTest.cs (1)
660optionsAccessor.SetupGet(o => o.Value).Returns(options);
RouteConstraintBuilderTest.cs (1)
181.SetupGet(o => o.Value)
RouteHandlerOptionsTests.cs (3)
29var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>().Value; 53var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>().Value; 66Assert.False(options.Value.ThrowOnBadRequest);
RouteOptionsTests.cs (2)
25Assert.Equal("TestRouteConstraint", accessor.Value.ConstraintMap["foo"].Name); 40var options = serviceProvider.GetRequiredService<IOptions<RouteOptions>>().Value;
RouteTest.cs (1)
1855.SetupGet(o => o.Value)
RoutingServiceCollectionExtensionsTests.cs (1)
80var regexRouteConstraintType = options.Value.ConstraintMap["regex"];
TemplateParserDefaultValuesTests.cs (1)
149accessor.Value.SetParameterPolicy<RegexInlineRouteConstraint>("regex");
Tree\TreeRouterTest.cs (1)
2064optionsMock.SetupGet(o => o.Value).Returns(options);
Microsoft.AspNetCore.Server.HttpSys (2)
MessagePump.cs (1)
34_options = options.Value;
WebHostBuilderHttpSysExtensions.cs (1)
40var options = services.GetRequiredService<IOptions<HttpSysOptions>>().Value;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
37Options = options.Value;
Utilities.cs (1)
107prefix = options.Value.UrlPrefixes.First(); // Has new port
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpServer.cs (1)
70_options = options.Value;
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
83_options = options.Value;
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\KestrelServerImpl.cs (1)
80var serverOptions = options.Value ?? new KestrelServerOptions();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeTransportFactory.cs (1)
32_options = options.Value;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
QuicTransportFactory.cs (1)
28_options = options.Value;
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
Client\SocketConnectionFactory.cs (2)
29_options = options.Value; 30_memoryPool = options.Value.MemoryPoolFactory();
SocketTransportFactory.cs (1)
32_options = options.Value;
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
51_options = options.Value;
Microsoft.AspNetCore.SignalR.Client (1)
HubConnectionBuilderHttpExtensions.cs (1)
171: base(httpConnectionOptions.Value.Url!)
Microsoft.AspNetCore.SignalR.Client.Core (3)
HubConnection.cs (3)
248ServerTimeout = options?.Value.ServerTimeout ?? DefaultServerTimeout; 250KeepAliveInterval = options?.Value.KeepAliveInterval ?? DefaultKeepAliveInterval; 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)
61_hubOptions = hubOptions.Value; 62_globalHubOptions = globalHubOptions.Value;
HubOptionsSetup`T.cs (1)
22_hubOptions = options.Value;
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
70_payloadSerializerOptions = options.Value.PayloadSerializerOptions;
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocol.cs (1)
50_worker = new DefaultMessagePackHubProtocolWorker(options.Value.SerializerOptions);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
60PayloadSerializer = JsonSerializer.Create(options.Value.PayloadSerializerSettings);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (4)
RedisHubLifetimeManager.cs (4)
73_options = options.Value; 78_protocol = new RedisProtocol(new DefaultHubMessageSerializer(hubProtocolResolver, globalHubOptions.Value.SupportedProtocols, hubOptions.Value.SupportedProtocols)); 86RedisLog.ConnectingToEndpoints(_logger, options.Value.Configuration.EndPoints, _serverName);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (5)
RedisDependencyInjectionExtensionsTests.cs (5)
28Assert.NotNull(options.Value); 29Assert.NotNull(options.Value.Configuration); 30Assert.Equal(password, options.Value.Configuration.Password); 31Assert.Collection(options.Value.Configuration.EndPoints, 38Assert.Equal(useSsl, options.Value.Configuration.Ssl);
Microsoft.AspNetCore.SignalR.Tests (9)
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,
Microsoft.AspNetCore.SpaProxy (5)
SpaProxyLaunchManager.cs (1)
28_options = options.Value;
SpaProxyMiddleware.cs (4)
46if (context.Request.Path.Equals(new Uri(_options.Value.ServerUrl).LocalPath)) 63await writer.WriteAsync(GenerateSpaLaunchPage(_options.Value)); 69_logger.LogInformation($"SPA proxy is ready. Redirecting to {_options.Value.GetRedirectUrl()}."); 71context.Response.Redirect(_options.Value.GetRedirectUrl());
Microsoft.AspNetCore.SpaServices.Extensions (2)
SpaApplicationBuilderExtensions.cs (1)
35var options = new SpaOptions(optionsProvider.Value);
StaticFiles\SpaStaticFilesExtensions.cs (1)
31var options = optionsProvider.Value;
Microsoft.AspNetCore.StaticFiles (3)
DefaultFilesMiddleware.cs (1)
37_options = options.Value;
DirectoryBrowserMiddleware.cs (1)
50_options = options.Value;
StaticFileMiddleware.cs (1)
40_options = options.Value;
Microsoft.AspNetCore.TestHost (1)
TestServer.cs (1)
50var options = optionsAccessor?.Value ?? throw new ArgumentNullException(nameof(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 (2)
WebHostTests.cs (2)
123Assert.True(routeOptions.Value.ConstraintMap.ContainsKey("regex")); 124Assert.Equal(typeof(RegexInlineRouteConstraint), routeOptions.Value.ConstraintMap["regex"]);
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
41_options = options.Value;
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)
63_options = options.Value;
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (1)
52_options = optionsAccessor.Value;
MemoryDistributedCache.cs (1)
38_memCache = new MemoryCache(optionsAccessor.Value, loggerFactory);
Microsoft.Extensions.Caching.SqlServer (1)
SqlServerCache.cs (1)
38var cacheOptions = options.Value;
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCache.cs (1)
97_options = optionsAccessor.Value;
Microsoft.Extensions.Compliance.Redaction (3)
HmacRedactor.cs (1)
45var value = Throw.IfMemberNull(options, options?.Value);
RedactorProvider.cs (2)
22var value = Throw.IfMemberNull(options, options.Value); 25_fallbackRedactor = GetFallbackRedactor(redactors, options.Value.FallbackRedactor);
Microsoft.Extensions.Compliance.Testing (5)
FakeRedactionServiceCollectionExtensions.cs (2)
32var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value; 58var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value;
FakeRedactor.cs (3)
44var r = validator.Validate(nameof(options), opt.Value); 48r = validator.Validate(nameof(options), opt.Value); 59_format = CompositeFormat.Parse(opt.Value.RedactionFormat);
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
AutoActivationHostedService.cs (1)
21_options = Throw.IfMemberNull(options, options.Value);
Microsoft.Extensions.Diagnostics.HealthChecks (7)
DefaultHealthCheckService.cs (2)
36ValidateRegistrations(_options.Value.Registrations); 42var registrations = _options.Value.Registrations;
HealthCheckPublisherHostedService.cs (5)
55return (registration?.Delay ?? _healthCheckPublisherOptions.Value.Delay, registration?.Period ?? _healthCheckPublisherOptions.Value.Period); 108foreach (var hc in _healthCheckServiceOptions.Value.Registrations) 152var timeout = _healthCheckPublisherOptions.Value.Timeout; 188return (GetTimerOptions(r) == timerOptions) && (_healthCheckPublisherOptions?.Value.Predicate ?? (_ => true))(r);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (2)
TelemetryHealthCheckPublisher.cs (2)
30var value = Throw.IfMemberNull(options, options.Value); 31_logOnlyUnhealthy = Throw.IfMemberNull(options, options.Value.LogOnlyUnhealthy);
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (2)
ApplicationLifecycleHealthChecksExtensionsTests.cs (1)
56var registrations = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value.Registrations;
ManualHealthCheckExtensionsTests.cs (1)
51var registrations = serviceProvider.GetRequiredService<IOptions<HealthCheckServiceOptions>>().Value.Registrations;
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (9)
DependencyInjection\HealthChecksBuilderTest.cs (9)
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; 218options.Value.Registrations,
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
TcpEndpointProbesExtensionsTests.cs (2)
60Assert.Equal(TimeSpan.FromSeconds(15), config.Value.HealthAssessmentPeriod); 123Assert.Equal(1234, configuration.Value.TcpPort);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
Linux\LinuxUtilizationProvider.cs (2)
46_cpuRefreshInterval = options.Value.CpuConsumptionRefreshInterval; 47_memoryRefreshInterval = options.Value.MemoryConsumptionRefreshInterval;
Linux\Network\LinuxTcpStateInfo.cs (1)
22_samplingInterval = options.Value.SamplingInterval;
ResourceMonitorService.cs (1)
73var optionsValue = Throw.IfMemberNull(options, options.Value);
Windows\Network\WindowsTcpStateInfo.cs (2)
30var stringAddresses = options.Value.SourceIpAddresses; 41_samplingInterval = options.Value.SamplingInterval;
Windows\WindowsContainerSnapshotProvider.cs (1)
53static () => new JobHandleWrapper(), TimeProvider.System, options.Value)
Windows\WindowsSnapshotProvider.cs (1)
40: this(logger, meterFactory, options.Value, TimeProvider.System, GetCpuUnits, GetCpuTicks, GetMemoryUsageInBytes, GetTotalMemoryInBytes)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (11)
Linux\AcceptanceTest.cs (6)
65Assert.NotNull(options.Value); 66Assert.Equal(cpuRefresh, options.Value.CpuConsumptionRefreshInterval); 67Assert.Equal(memoryRefresh, options.Value.MemoryConsumptionRefreshInterval); 87Assert.NotNull(options.Value); 88Assert.Equal(cpuRefresh, options.Value.CpuConsumptionRefreshInterval); 89Assert.Equal(memoryRefresh, options.Value.MemoryConsumptionRefreshInterval);
ResourceMonitoringExtensionsTests.cs (5)
138Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 139Assert.Equal(TimeSpan.FromSeconds(CalculationPeriodValue), options!.Value.PublishingWindow); 178Assert.Equal(TimeSpan.FromSeconds(SamplingWindowValue), options!.Value.CollectionWindow); 179Assert.Equal(TimeSpan.FromSeconds(SamplingPeriodValue), options!.Value.SamplingInterval); 180Assert.Equal(TimeSpan.FromSeconds(CalculationPeriod), options!.Value.PublishingWindow);
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogCollector.cs (1)
28_options = Throw.IfNullOrMemberNull(options, options?.Value);
Microsoft.Extensions.Hosting (5)
Internal\ConsoleLifetime.cs (4)
48ThrowHelper.ThrowIfNull(options?.Value, nameof(options)); 51ThrowHelper.ThrowIfNull(hostOptions?.Value, nameof(hostOptions)); 54Options = options.Value; 57HostOptions = hostOptions.Value;
Internal\Host.cs (1)
58_options = options?.Value ?? throw new ArgumentNullException(nameof(options));
Microsoft.Extensions.Hosting.WindowsServices (2)
WindowsServiceLifetime.cs (2)
57_hostOptions = optionsAccessor.Value; 58ServiceName = windowsServiceOptionsAccessor.Value.ServiceName;
Microsoft.Extensions.Http.Diagnostics (3)
Latency\Internal\HttpLatencyTelemetryHandler.cs (3)
29var appMetadata = Throw.IfMemberNull(appMetdata, appMetdata.Value); 30var telemetryOptions = Throw.IfMemberNull(options, options.Value); 35_applicationName = appMetdata.Value.ApplicationName;
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)
28sop.Setup(a => a.Value).Returns(new ApplicationMetadata()); 30hop.Setup(a => a.Value).Returns(new HttpClientLatencyTelemetryOptions()); 49sop.Setup(a => a.Value).Returns(new ApplicationMetadata()); 51hop.Setup(a => a.Value).Returns(new HttpClientLatencyTelemetryOptions()); 91sop.Setup(a => a.Value).Returns(new ApplicationMetadata()); 93hop.Setup(a => a.Value).Returns(new HttpClientLatencyTelemetryOptions { EnableDetailedLatencyBreakdown = false });
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)
47var options = optionsAccessor?.Value ?? DefaultOptions;
UserClaimsPrincipalFactory.cs (2)
29if (optionsAccessor == null || optionsAccessor.Value == null) 35Options = optionsAccessor.Value;
UserManager.cs (1)
81Options = optionsAccessor?.Value ?? new IdentityOptions();
Microsoft.Extensions.Localization (1)
ResourceManagerStringLocalizerFactory.cs (1)
43_resourcesRelativePath = localizationOptions.Value.ResourcesPath ?? string.Empty;
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
StringLocalizerOfTRootNamespaceTest.cs (1)
19options.Setup(o => o.Value).Returns(locOptions);
Microsoft.Extensions.Localization.Tests (11)
ResourceManagerStringLocalizerFactoryTest.cs (11)
65options.Setup(o => o.Value).Returns(locOptions); 97options.Setup(o => o.Value).Returns(locOptions); 115options.Setup(o => o.Value).Returns(locOptions); 133options.Setup(o => o.Value).Returns(locOptions); 161options.Setup(o => o.Value).Returns(locOptions); 191options.Setup(o => o.Value).Returns(locOptions); 212options.Setup(o => o.Value).Returns(locOptions); 231options.Setup(o => o.Value).Returns(locOptions); 250options.Setup(o => o.Value).Returns(locOptions); 271options.Setup(o => o.Value).Returns(locOptions); 292options.Setup(o => o.Value).Returns(locOptions);
Microsoft.Extensions.Logging (2)
LoggerFactory.cs (2)
85_factoryOptions = options == null || options.Value == null ? new LoggerFactoryOptions() : options.Value;
Microsoft.Extensions.Logging.EventLog (1)
EventLogLoggerProvider.cs (1)
40: this(options.Value)
Microsoft.Extensions.ML (4)
ModelLoaders\FileModelLoader.cs (1)
31_context = contextOptions.Value?.MLContext ?? throw new ArgumentNullException(nameof(contextOptions));
ModelLoaders\UriModelLoader.cs (1)
38_context = contextOptions.Value?.MLContext;
PoolLoader.cs (1)
28Context = contextOptions.Value.MLContext ?? throw new ArgumentNullException(nameof(contextOptions));
PredictionEnginePool.cs (1)
31_mlContextOptions = mlContextOptions.Value;
Microsoft.Extensions.ML.Tests (1)
FileLoaderTests.cs (1)
51var context = sp.GetRequiredService<IOptions<MLOptions>>().Value.MLContext;
Microsoft.Extensions.Options (1)
ValidateOnStart.cs (1)
17_validatorOptions = validators.Value;
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 (10)
Configuration\ConfigurationServiceEndpointProvider.cs (7)
43_includeAllSchemes = serviceDiscoveryOptions.Value.AllowAllSchemes && query.IncludedSchemes.Count == 0; 44_schemes = ServiceDiscoveryOptions.ApplyAllowedSchemes(query.IncludedSchemes, serviceDiscoveryOptions.Value.AllowedSchemes, serviceDiscoveryOptions.Value.AllowAllSchemes); 64var section = _configuration.GetSection(_options.Value.SectionName).GetSection(_serviceName); 68Log.ServiceConfigurationNotFound(_logger, _serviceName, $"{_options.Value.SectionName}:{_serviceName}"); 100var configPath = $"{_options.Value.SectionName}:{_serviceName}:{endpointName}"; 233if (_options.Value.ShouldApplyHostNameMetadata(serviceEndpoint))
Http\ResolvingHttpDelegatingHandler.cs (2)
25_options = options.Value; 37_options = options.Value;
ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
64_options = options.Value;
Microsoft.Extensions.Telemetry (9)
Enrichment\ApplicationLogEnricher.cs (2)
20var enricherOptions = Throw.IfMemberNull(options, options.Value); 21var applicationMetadata = Throw.IfMemberNull(metadata, metadata.Value);
Enrichment\ProcessLogEnricher.cs (1)
22var enricherOptions = Throw.IfMemberNull(options, options.Value);
Enrichment\StaticProcessLogEnricher.cs (1)
20var enricherOptions = Throw.IfMemberNull(options, options.Value);
Latency\Internal\LatencyConsoleExporter.cs (1)
37var o = options.Value;
Latency\Internal\LatencyContextRegistrySet.cs (2)
34var latencyContextRegistrationOptions = registrationOptions != null ? registrationOptions.Value : new LatencyContextRegistrationOptions(); 35var throwOnUnregisteredNames = latencyContextOptions.Value.ThrowOnUnregisteredNames;
Logging\ExtendedLoggerFactory.cs (2)
47_factoryOptions = factoryOptions == null || factoryOptions.Value == null ? new LoggerFactoryOptions() : factoryOptions.Value;
Microsoft.Extensions.Telemetry.Abstractions.Tests (2)
Latency\LatencyRegistryExtensionsTests.cs (2)
47Assert.NotNull(option!.Value); 48CheckNumberOfRegisteredNames(option.Value!);
Microsoft.Extensions.Telemetry.Tests (18)
Enrichment\ApplicationEnricherExtensionsTests.cs (2)
62var options = host.Services.GetRequiredService<IOptions<ApplicationLogEnricherOptions>>().Value; 88var options = host.Services.GetRequiredService<IOptions<ApplicationLogEnricherOptions>>().Value;
Enrichment\ApplicationLogEnricherTests.cs (2)
40optionsNull.Setup(o => o.Value).Returns<IOptions<ApplicationLogEnricherOptions>>(null!); 43serviceOptionsNull.Setup(o => o.Value).Returns<IOptions<ApplicationMetadata>>(null!);
Enrichment\Internals\TestExtensions.cs (1)
15mock.Setup(o => o.Value).Returns(options);
Enrichment\ProcessEnricherExtensionsTests.cs (2)
63var options = host.Services.GetRequiredService<IOptions<ProcessLogEnricherOptions>>().Value; 86var options = host.Services.GetRequiredService<IOptions<ProcessLogEnricherOptions>>().Value;
Enrichment\ProcessLogEnricherTests.cs (1)
24optionsNull.Setup(o => o.Value).Returns<IOptions<ProcessLogEnricherOptions>>(null!);
Latency\Internal\LatencyContextPoolTests.cs (1)
102lco.Setup(a => a.Value).Returns(new LatencyContextOptions { ThrowOnUnregisteredNames = false });
Latency\Internal\LatencyContextProviderTests.cs (2)
99lco.Setup(a => a.Value).Returns(options); 109lco.Setup(a => a.Value).Returns(options);
Latency\Internal\LatencyContextRegistrySetTests.cs (2)
18lco.Setup(a => a.Value).Returns(new LatencyContextOptions()); 85lco.Setup(a => a.Value).Returns(new LatencyContextOptions());
Latency\Internal\LatencyContextTests.cs (1)
298lco.Setup(a => a.Value).Returns(new LatencyContextOptions { ThrowOnUnregisteredNames = false });
Latency\Internal\LatencyContextTokenIssuerTests.cs (1)
67lco.Setup(a => a.Value).Returns(new LatencyContextOptions { ThrowOnUnregisteredNames = false });
Latency\Internal\MockLatencyContextRegistrationOptions.cs (1)
23lcro.Setup(a => a.Value).Returns(options);
Latency\LatencyConsoleExtensionsTests.cs (1)
64Assert.True(actualOptions.Value.OutputTags);
Latency\LatencyContextExtensionTests.cs (1)
100Assert.True(actualOptions.Value.ThrowOnUnregisteredNames == expectedOptions.ThrowOnUnregisteredNames);
Microsoft.Extensions.WebEncoders (1)
EncoderServiceCollectionExtensions.cs (1)
68?.Value
RoutingSandbox (1)
HelloExtension\HelloMiddleware.cs (1)
18_helloOptions = helloOptions.Value;
RoutingWebSite (1)
HelloExtension\HelloMiddleware.cs (1)
18_helloOptions = helloOptions.Value;
Sockets.BindTests (1)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (1)
330var options = ((IOptions<KestrelServerOptions>)host.Services.GetService(typeof(IOptions<KestrelServerOptions>))).Value;
XmlFormattersWebSite (2)
Controllers\XmlDataContractApiController.cs (1)
27var xmlFormatter = mvcOptions.Value.OutputFormatters.OfType<XmlDataContractSerializerOutputFormatter>().First();
Controllers\XmlSerializedApiController.cs (1)
27var xmlFormatter = mvcOptions.Value.OutputFormatters.OfType<XmlSerializerOutputFormatter>().First();