614 references to Options
Aspire.Dashboard (6)
Components\Layout\MainLayout.razor.cs (2)
63public required IOptionsMonitor<DashboardOptions> Options { get; init; } 104if (Options.CurrentValue.Otlp.AuthMode == OtlpAuthMode.Unsecured)
Components\Pages\ConsoleLogs.razor.cs (3)
44public required IOptions<DashboardOptions> Options { get; init; } 104_logEntries = new(Options.Value.Frontend.MaxConsoleLogCount); 242_logEntries = new(Options.Value.Frontend.MaxConsoleLogCount);
Utils\GlobalizationHelpers.cs (1)
136var middleware = new RequestLocalizationMiddleware(c => Task.CompletedTask, Options.Create(new RequestLocalizationOptions
Aspire.Dashboard.Components.Tests (5)
Pages\ConsoleLogsTests.cs (1)
166Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Pages\StructuredLogsTests.cs (1)
178Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Pages\TraceDetailsTests.cs (1)
170Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
Shared\MetricsSetupHelpers.cs (1)
77context.Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new DashboardOptions()));
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
253Options.Create(new DashboardOptions { TelemetryLimits = options }));
Aspire.Dashboard.Tests (3)
Integration\DashboardClientAuthTests.cs (1)
133dashboardOptions: Options.Create(options),
Model\DashboardClientTests.cs (1)
38_dashboardOptions = Options.Create(options);
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
253Options.Create(new DashboardOptions { TelemetryLimits = options }));
Aspire.Hosting.Tests (6)
Dashboard\DashboardLifecycleHookTests.cs (4)
109codespacesOptions ??= Options.Create(new CodespacesOptions()); 110devcontainersOptions ??= Options.Create(new DevcontainersOptions()); 116Options.Create(new DashboardOptions { DashboardPath = "test.dll" }), 123new DcpNameGenerator(configuration, Options.Create(new DcpOptions())),
Dcp\ApplicationExecutorTests.cs (2)
1080Options.Create(dcpOptions), 1090new DcpNameGenerator(configuration, Options.Create(dcpOptions))
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\TracerProviderBuilderExtensions.cs (1)
64name ??= Options.DefaultName;
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\TracerProviderBuilderExtensions.cs (1)
64name ??= Options.DefaultName;
Aspire.OpenAI (1)
AspireOpenAIExtensions.cs (1)
87var optionsName = serviceKey is null ? Options.Options.DefaultName : connectionName;
Aspire.StackExchange.Redis (3)
AspireRedisExtensions.cs (1)
84var optionsName = serviceKey is null ? Options.Options.DefaultName : connectionName;
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisInstrumentation.cs (1)
31=> this.AddConnection(Options.DefaultName, connection);
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\TracerProviderBuilderExtensions.cs (1)
104name ??= Options.DefaultName;
Cookies (1)
ConfigureMyCookie.cs (1)
26=> Configure(Options.DefaultName, options);
KeyManagementSimulator (1)
Program.cs (1)
347var keyManagementOptions = Options.Create(new KeyManagementOptions()
Microsoft.AspNetCore.Authentication.BearerToken (6)
BearerTokenHandler.cs (6)
43var ticket = Options.BearerTokenProtector.Unprotect(token); 69properties.ExpiresUtc = utcNow + Options.BearerTokenExpiration; 73AccessToken = Options.BearerTokenProtector.Protect(CreateBearerTicket(user, properties)), 74ExpiresIn = (long)Options.BearerTokenExpiration.TotalSeconds, 75RefreshToken = Options.RefreshTokenProtector.Protect(CreateRefreshTicket(user, utcNow)), 110ExpiresUtc = utcNow + Options.RefreshTokenExpiration
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerConfigureOptions.cs (1)
96Configure(Options.DefaultName, options);
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectConfigureOptions.cs (1)
126Configure(Options.DefaultName, options);
Microsoft.AspNetCore.Authentication.Test (1)
CertificateTests.cs (1)
881services.AddSingleton<ICertificateValidationCache>(new CertificateValidationCache(Options.Create(new CertificateValidationCacheOptions()), timeProvider));
Microsoft.AspNetCore.Authorization (1)
PassThroughAuthorizationHandler.cs (1)
21public PassThroughAuthorizationHandler() : this(Options.Create(new AuthorizationOptions()))
Microsoft.AspNetCore.Authorization.Test (9)
AuthorizationMiddlewareTests.cs (1)
357var policyProvider = new TestDefaultPolicyProvider(Options.Create(new AuthorizationOptions()), canCache);
AuthorizationPolicyFacts.cs (7)
31var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 59var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 81var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 103var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 125var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 145var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options)); 164var provider = new DefaultAuthorizationPolicyProvider(Options.Create(options));
DefaultAuthorizationServiceTests.cs (1)
27var provider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions()));
Microsoft.AspNetCore.Components (1)
Routing\RouteTableFactory.cs (1)
118var routeOptions = Options.Create(new RouteOptions());
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
HttpContextFormValueMapperTest.cs (1)
40var mapper = new HttpContextFormValueMapper(formData, Options.Create<RazorComponentsServiceOptions>(new()));
Microsoft.AspNetCore.Components.Server.Tests (39)
CircuitDisconnectMiddlewareTest.cs (7)
24Options.Create(new CircuitOptions()), 52Options.Create(new CircuitOptions()), 79Options.Create(new CircuitOptions()), 106Options.Create(new CircuitOptions()), 139Options.Create(new CircuitOptions()), 174Options.Create(new CircuitOptions()), 211Options.Create(new CircuitOptions()),
Circuits\CircuitHostTest.cs (2)
729=> new RemoteJSRuntime(Options.Create(options), Options.Create(new HubOptions<ComponentHub>()), null);
Circuits\CircuitRegistryTest.cs (2)
357: base(Options.Create(circuitOptions ?? new CircuitOptions()), NullLogger<CircuitRegistry>.Instance, factory) 396Options.Create(new CircuitOptions()),
Circuits\ComponentHubTest.cs (2)
111Options.Create(new CircuitOptions())); 113Options.Create(new CircuitOptions()),
Circuits\RemoteJSDataStreamTest.cs (20)
15private static readonly TestRemoteJSRuntime _jsRuntime = new(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 48var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 76var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 104var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 122var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 141var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 160var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 180var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 205var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>()); 246var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>());
Circuits\RemoteJSRuntimeTest.cs (2)
102var componentHubOptions = Options.Create(new HubOptions<ComponentHub>()); 104var jsRuntime = new TestRemoteJSRuntime(Options.Create(new CircuitOptions()), componentHubOptions, Mock.Of<ILogger<RemoteJSRuntime>>());
Circuits\RemoteRendererTest.cs (2)
726=> new RemoteJSRuntime(Options.Create(options), Options.Create(new HubOptions<ComponentHub>()), null);
Circuits\TestCircuitHost.cs (2)
31var jsRuntime = new RemoteJSRuntime(Options.Create(new CircuitOptions()), Options.Create(new HubOptions<ComponentHub>()), Mock.Of<ILogger<RemoteJSRuntime>>());
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (9)
PolicyTests\StackPolicyTests.cs (6)
13var stack = new StackPolicy(Options.Create(new QueuePolicyOptions 38var stack = new StackPolicy(Options.Create(new QueuePolicyOptions 67var stack = new StackPolicy(Options.Create(new QueuePolicyOptions 86var stack = new StackPolicy(Options.Create(new QueuePolicyOptions 110var stack = new StackPolicy(Options.Create(new QueuePolicyOptions 137var stack = new StackPolicy(Options.Create(new QueuePolicyOptions
TestUtils.cs (3)
15var options = Options.Create(new ConcurrencyLimiterOptions 48var options = Options.Create(new QueuePolicyOptions 59var options = Options.Create(new QueuePolicyOptions
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyAppBuilderExtensions.cs (1)
37return app.UseMiddleware<CookiePolicyMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Cors.Test (4)
CorsMiddlewareTests.cs (1)
641var corsService = new CorsService(Options.Create(new CorsOptions()), NullLoggerFactory.Instance);
CorsServiceTests.cs (1)
940return new CorsService(Options.Create(options), NullLoggerFactory.Instance);
DefaultCorsPolicyProviderTests.cs (2)
19var corsOptions = Options.Create(options); 39var corsOptions = Options.Create(options);
Microsoft.AspNetCore.DataProtection (1)
Internal\KeyManagementOptionsPostSetup.cs (1)
64if (name != Options.DefaultName)
Microsoft.AspNetCore.DataProtection.Tests (27)
Internal\KeyManagementOptionsPostSetupTest.cs (7)
31setup.PostConfigure(Options.DefaultName, options); 48setup.PostConfigure(Options.DefaultName + 1, options); 67setup.PostConfigure(Options.DefaultName, options); 92setup.PostConfigure(Options.DefaultName, options); 119setup.PostConfigure(Options.DefaultName, options); 135setup.PostConfigure(Options.DefaultName, options); 149setup.PostConfigure(Options.DefaultName, options);
KeyManagement\DefaultKeyResolverTests.cs (3)
318var options = Options.Create(new KeyManagementOptions() 395var options = Options.Create(new KeyManagementOptions() 450return new DefaultKeyResolver(Options.Create(new KeyManagementOptions()), NullLoggerFactory.Instance);
KeyManagement\KeyRingBasedDataProtectorTests.cs (1)
238keyManagementOptions: Options.Create(options),
KeyManagement\KeyRingProviderTests.cs (2)
887keyManagementOptions: Options.Create(options), 904keyManagementOptions: Options.Create(keyManagementOptions),
KeyManagement\XmlKeyManagerTests.cs (14)
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() 937Options.Create(new KeyManagementOptions() 985var withDeletion = new XmlKeyManager(Options.Create(new KeyManagementOptions() 992var withoutDeletion = new XmlKeyManager(Options.Create(new KeyManagementOptions()
Microsoft.AspNetCore.Diagnostics (5)
DeveloperExceptionPage\DeveloperExceptionPageExtensions.cs (1)
47return app.UseMiddleware<DeveloperExceptionPageMiddlewareImpl>(Options.Create(options));
ExceptionHandler\ExceptionHandlerExtensions.cs (1)
103var iOptions = Options.Create(options);
StatusCodePage\StatusCodePagesExtensions.cs (2)
30return app.UseMiddleware<StatusCodePagesMiddleware>(Options.Create(options)); 156Options.Create(new StatusCodePagesOptions() { HandleAsync = CreateHandler(pathFormat, queryFormat, newNext) })).Invoke;
WelcomePage\WelcomePageExtensions.cs (1)
26return app.UseMiddleware<WelcomePageMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
DatabaseErrorPageExtensions.cs (1)
47app = app.UseMiddleware<DatabaseErrorPageMiddleware>(Options.Create(options));
MigrationsEndPointExtensions.cs (1)
38return app.UseMiddleware<MigrationsEndPointMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Diagnostics.HealthChecks (4)
Builder\HealthCheckApplicationBuilderExtensions.cs (3)
62UseHealthChecksCore(app, path, port: null, new[] { Options.Create(options), }); 148UseHealthChecksCore(app, path, port, new[] { Options.Create(options), }); 187UseHealthChecksCore(app, path, portAsInt, new[] { Options.Create(options), });
Builder\HealthCheckEndpointRouteBuilderExtensions.cs (1)
65var args = options != null ? new[] { Options.Create(options) } : Array.Empty<object>();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (11)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (11)
33Options.Create(new RequestLatencyTelemetryOptions()), new List<ILatencyDataExporter> { ex1, ex2 }, 34Options.Create(new ApplicationMetadata { ApplicationName = serverName })); 63Options.Create(new RequestLatencyTelemetryOptions()), 92Options.Create(new RequestLatencyTelemetryOptions()), new List<ILatencyDataExporter> { ex1, ex2 }, 93Options.Create(new ApplicationMetadata { ApplicationName = serverName })); 121Options.Create(new RequestLatencyTelemetryOptions()), 123Options.Create(new ApplicationMetadata())); 150Options.Create(new RequestLatencyTelemetryOptions()), 152Options.Create(new ApplicationMetadata())); 172Options.Create(new RequestLatencyTelemetryOptions { LatencyDataExportTimeout = exportTimeout }), 174Options.Create(new ApplicationMetadata()));
Microsoft.AspNetCore.HeaderParsing (1)
HeaderKey.cs (1)
44_valueCache = new MemoryCache(Options.Create(o));
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingFeatureTests.cs (1)
36_options = Options.Create(new HeaderParsingOptions());
HeaderRegistryTests.cs (1)
20_options = Options.Create(new HeaderParsingOptions());
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (1)
3777Options.Create(connectionOptions),
HttpConnectionManagerTests.cs (1)
431return new HttpConnectionManager(loggerFactory, lifetime, Options.Create(new ConnectionOptions()), metrics ?? new HttpConnectionsMetrics(new TestMeterFactory()));
Microsoft.AspNetCore.Http.Extensions.Tests (10)
ProblemDetailsDefaultWriterTest.cs (2)
706return new DefaultProblemDetailsWriter(Options.Create(options), Options.Create(jsonOptions));
RequestDelegateFactoryTests.cs (3)
866return Options.Create(jsonOptions); 1344.AddSingleton(Options.Create(new JsonOptions())) 1376.AddSingleton(Options.Create(new JsonOptions()))
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (2)
227return Options.Create(jsonOptions); 283return Options.Create(jsonOptions);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
648.AddSingleton(Options.Create(new JsonOptions())) 671.AddSingleton(Options.Create(new JsonOptions())) 759.AddSingleton(Options.Create(new JsonOptions()))
Microsoft.AspNetCore.HttpOverrides (2)
ForwardedHeadersExtensions.cs (1)
55return builder.UseMiddleware<ForwardedHeadersMiddleware>(Options.Create(options));
HttpMethodOverrideExtensions.cs (1)
40return builder.UseMiddleware<HttpMethodOverrideMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Identity.Test (1)
SignInManagerTest.cs (1)
1284var options = Options.Create(new IdentityOptions());
Microsoft.AspNetCore.Localization (3)
ApplicationBuilderExtensions.cs (3)
41return app.UseMiddleware<RequestLocalizationMiddleware>(Options.Create(options)); 64return app.UseMiddleware<RequestLocalizationMiddleware>(Options.Create(options)); 94return app.UseMiddleware<RequestLocalizationMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (5)
DefaultApiDescriptionProviderTest.cs (2)
2238var optionsAccessor = Options.Create(options); 2251Options.Create(routeOptions ?? new RouteOptions()));
EndpointMetadataApiDescriptionProviderTest.cs (3)
1373new DefaultParameterPolicyFactory(Options.Create(new RouteOptions()), new TestServiceProvider()), 1569new DefaultParameterPolicyFactory(Options.Create(new RouteOptions()), new TestServiceProvider()), 1698return Options.Create(new RouteHandlerOptions());
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\MvcCoreMvcOptionsSetup.cs (1)
30: this(readerFactory, NullLoggerFactory.Instance, Options.Create(new JsonOptions()))
Microsoft.AspNetCore.Mvc.Core.Test (94)
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 (11)
16private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false }); 23new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())), 24Options.Create(new MvcOptions())); 41new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())), 42Options.Create(new MvcOptions())); 59new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())), 76var options = Options.Create(new AuthorizationOptions()); 107new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())), 130var authOptions = Options.Create(new AuthorizationOptions()); 179new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())), 209Options.Create(new MvcOptions()),
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\DefaultApplicationModelProviderTest.cs (1)
1875: base(Options.Create(options), modelMetadataProvider)
ApplicationModels\EndpointMetadataProviderTest.cs (1)
242var options = Options.Create(new MvcOptions());
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
913var mvcOptions = Options.Create(new MvcOptions());
Authorization\AuthorizeFilterTest.cs (1)
550var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(options));
ControllerBaseTest.cs (10)
2347ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2376ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2398ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2419ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2440ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2466ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2493ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2517ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 2538ProblemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(options)), 3209Options.Create(new MvcDataAnnotationsLocalizationOptions()),
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\ApiBehaviorOptionsSetupTest.cs (1)
141return new DefaultProblemDetailsFactory(Options.Options.Create(options));
Formatters\FormatFilterTest.cs (1)
457OptionsManager = Options.Create(new MvcOptions());
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 (4)
24configure.PostConfigure(Options.DefaultName, options); 47configure.PostConfigure(Options.DefaultName, options); 67configure.PostConfigure(Options.DefaultName, options); 77var compatibilityOptions = Options.Create(new MvcCompatibilityOptions() { CompatibilityVersion = version });
Infrastructure\ControllerActionInvokerCacheTest.cs (1)
96var mvcOptions = Options.Create(new MvcOptions());
Infrastructure\ControllerActionInvokerProviderTest.cs (3)
73Options.Create(mvcOptions), 82Options.Create(mvcOptions)); 86Options.Create(mvcOptions),
Infrastructure\ControllerActionInvokerTest.cs (1)
1705var options = Options.Create(new MvcOptions());
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (3)
229var mvcOptions = Options.Create(new MvcOptions()); 235new DefaultProblemDetailsFactory(Options.Create(options), null), 236Options.Create(options));
Infrastructure\DefaultOutputFormatterSelectorTest.cs (1)
376return new DefaultOutputFormatterSelector(Options.Create(options), NullLoggerFactory.Instance);
Infrastructure\ObjectResultExecutorTest.cs (1)
480var optionsAccessor = Options.Create(options);
Infrastructure\ProblemDetailsFactoryTest.cs (1)
184return new DefaultProblemDetailsFactory(Options.Create(options));
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (4)
17var problemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(new ApiBehaviorOptions 44var problemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(new ApiBehaviorOptions 74var problemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(new ApiBehaviorOptions 100var problemDetailsFactory = new DefaultProblemDetailsFactory(Options.Create(new ApiBehaviorOptions
Infrastructure\SystemTextJsonResultExecutorTest.cs (1)
16Options.Create(new JsonOptions()),
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (1)
1086var options = Options.Create(new MvcOptions());
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (1)
1248var options = Options.Create(new MvcOptions());
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
343services.AddSingleton(Options.Create(options));
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (1)
435Options.Create(new MvcOptions()));
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\ModelBindingHelperTest.cs (7)
58Options.Create(new MvcDataAnnotationsLocalizationOptions()), 100Options.Create(new MvcDataAnnotationsLocalizationOptions()), 166Options.Create(new MvcDataAnnotationsLocalizationOptions()), 246Options.Create(new MvcDataAnnotationsLocalizationOptions()), 297Options.Create(new MvcDataAnnotationsLocalizationOptions()), 496Options.Create(new MvcDataAnnotationsLocalizationOptions()), 576Options.Create(new MvcDataAnnotationsLocalizationOptions()),
ModelBinding\ParameterBinderTest.cs (1)
26private static readonly IOptions<MvcOptions> _optionsAccessor = Options.Create(new MvcOptions());
ModelBinding\TestModelBinderProviderContext.cs (1)
103services.AddSingleton(Options.Create(mvcOptions));
ObjectResultTests.cs (1)
159var options = Options.Create(new MvcOptions());
RequireHttpsAttributeTests.cs (2)
168var options = Options.Create(new MvcOptions()); 235var options = Options.Create(new MvcOptions());
ResponseCacheAttributeTest.cs (1)
326var optionsAccessor = Options.Create(new MvcOptions());
Microsoft.AspNetCore.Mvc.Core.TestCommon (11)
TestClientModelValidatorProvider.cs (1)
19Options.Create(new MvcDataAnnotationsLocalizationOptions()),
TestModelBinderFactory.cs (2)
36var options = Options.Create(new MvcOptions()); 58var options = Options.Create(new MvcOptions());
TestModelMetadataProvider.cs (7)
18var localizationOptions = Options.Create(new MvcDataAnnotationsLocalizationOptions()); 41return new DefaultModelMetadataProvider(compositeDetailsProvider, Options.Create(new MvcOptions())); 52Options.Create(new MvcDataAnnotationsLocalizationOptions()), 65return new DefaultModelMetadataProvider(compositeDetailsProvider, Options.Create(new MvcOptions())); 77return new DefaultModelMetadataProvider(compositeDetailsProvider, Options.Create(new MvcOptions())); 95Options.Create(new MvcDataAnnotationsLocalizationOptions()), 99Options.Create(new MvcOptions()))
TestModelValidatorProvider.cs (1)
15var options = Options.Create(new MvcDataAnnotationsLocalizationOptions());
Microsoft.AspNetCore.Mvc.Cors.Test (2)
CorsApplicationModelProviderTest.cs (2)
20private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false }); 215Options.Create(new MvcOptions()),
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (14)
DataAnnotationsClientModelValidatorProviderTest.cs (5)
21Options.Create(new MvcDataAnnotationsLocalizationOptions()), 44Options.Create(new MvcDataAnnotationsLocalizationOptions()), 75Options.Create(new MvcDataAnnotationsLocalizationOptions()), 97Options.Create(new MvcDataAnnotationsLocalizationOptions()), 121Options.Create(new MvcDataAnnotationsLocalizationOptions()),
DataAnnotationsMetadataProviderTest.cs (1)
1702Options.Create(localizationOptions ?? new MvcDataAnnotationsLocalizationOptions()),
DataAnnotationsModelValidatorProviderTest.cs (5)
22Options.Create(new MvcDataAnnotationsLocalizationOptions()), 42Options.Create(new MvcDataAnnotationsLocalizationOptions()), 65Options.Create(new MvcDataAnnotationsLocalizationOptions()), 96Options.Create(new MvcDataAnnotationsLocalizationOptions()), 156Options.Create(new MvcDataAnnotationsLocalizationOptions()),
ModelMetadataProviderTest.cs (2)
1051Options.Create(new MvcDataAnnotationsLocalizationOptions()), 1054Options.Create(new MvcOptions()))
MvcDataAnnotationsMvcOptionsSetup.cs (1)
22Options.Create(new MvcDataAnnotationsLocalizationOptions()));
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
808.AddSingleton(Options.Create(new MvcOptions()))
XmlSerializerOutputFormatterTest.cs (1)
590.AddSingleton(Options.Create(new MvcOptions()))
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
AuthorizeFilterIntegrationTest.cs (3)
59var policyProvider = new Mock<DefaultAuthorizationPolicyProvider>(Options.Create<AuthorizationOptions>(new AuthorizationOptions())); 90var policyProvider = new Mock<DefaultAuthorizationPolicyProvider>(Options.Create<AuthorizationOptions>(new AuthorizationOptions())); 169Options.Create(new MvcOptions()),
ModelBindingTestHelper.cs (1)
191serviceCollection.AddSingleton(Options.Create(mvcOptions));
TestMvcOptions.cs (2)
24var dataAnnotationLocalizationOptions = Options.Create(new MvcDataAnnotationsLocalizationOptions()); 38var jsonOptions = Options.Create(new MvcNewtonsoftJsonOptions());
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (6)
JsonResultTest.cs (2)
47Options.Create(new MvcOptions()), 48Options.Create(new MvcNewtonsoftJsonOptions()),
NewtonsoftJsonHelperTest.cs (2)
25Options.Create(options), 92Options.Create(options),
NewtonsoftJsonResultExecutorTest.cs (2)
21Options.Create(new MvcOptions()), 22Options.Create(new MvcNewtonsoftJsonOptions()),
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (6)
FileProviderRazorProjectFileSystemTest.cs (1)
246var options = Options.Create(new MvcRazorRuntimeCompilationOptions
RazorReferenceManagerTest.cs (1)
25Options.Create(options));
RuntimeCompilationFileProviderTest.cs (1)
19var options = Options.Create(new MvcRazorRuntimeCompilationOptions());
RuntimeViewCompilerTest.cs (2)
827var options = Options.Create(new MvcRazorRuntimeCompilationOptions 858return new RazorReferenceManager(applicationPartManager, Options.Create(new MvcRazorRuntimeCompilationOptions()));
TestInfrastructure\TestRazorReferenceManager.cs (1)
15Options.Create(new MvcRazorRuntimeCompilationOptions()))
Microsoft.AspNetCore.Mvc.RazorPages.Test (34)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (8)
17private readonly IOptions<MvcOptions> OptionsWithoutEndpointRouting = Options.Create(new MvcOptions { EnableEndpointRouting = false }); 23var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())); 57var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())); 58var authorizationProvider = new AuthorizationPageApplicationModelProvider(policyProvider, Options.Create(new MvcOptions())); 76var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())); 110var options = Options.Create(new AuthorizationOptions()); 158var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions())); 192Options.Create(new RazorPagesOptions()),
ApplicationModels\CompiledPageRouteModelProviderTest.cs (1)
478Options.Create(options),
ApplicationModels\DefaultPageApplicationModelProviderTest.cs (1)
1223Options.Create(new RazorPagesOptions()),
ApplicationModels\ResponseCacheFilterApplicationModelProviderTest.cs (4)
22var options = Options.Create(new MvcOptions()); 56var options = Options.Create(new MvcOptions()); 98var options = Options.Create(new MvcOptions()); 146Options.Create(new RazorPagesOptions()),
DependencyInjection\PageConventionCollectionExtensionsTest.cs (1)
980.AddSingleton<IOptions<MvcOptions>>(Options.Options.Create(options))
DependencyInjection\RazorPagesRazorViewEngineOptionsSetupTest.cs (7)
29Options.Options.Create(razorPagesOptions)); 52Options.Options.Create(razorPagesOptions)); 77Options.Options.Create(razorPagesOptions)); 105Options.Options.Create(razorPagesOptions)); 131Options.Options.Create(razorPagesOptions)); 158Options.Options.Create(razorPagesOptions)); 172var setup = new RazorPagesRazorViewEngineOptionsSetup(Options.Options.Create(new RazorPagesOptions()));
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 (1)
371return Options.Create(new RazorPagesOptions { Conventions = new PageConventionCollection(Mock.Of<IServiceProvider>()) });
Infrastructure\PageActionInvokerProviderTest.cs (3)
512Options.Create(mvcOptions), 529Options.Create(mvcOptions), 530Options.Create(new MvcViewOptions()),
Infrastructure\PageBinderFactoryTest.cs (1)
21private static readonly IOptions<MvcOptions> _optionsAccessor = Options.Create(_options);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
DistributedCacheTagHelperTest.cs (4)
354var storage = GetStorage(Options.Create(new MemoryDistributedCacheOptions { Clock = clock.Object })); 416var storage = GetStorage(Options.Create(new MemoryDistributedCacheOptions { Clock = clock.Object })); 478var storage = GetStorage(Options.Create(new MemoryDistributedCacheOptions { Clock = clock.Object })); 776return new DistributedCacheTagHelperStorage(new MemoryDistributedCache(options ?? Options.Create(new MemoryDistributedCacheOptions())));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (33)
ControllerTest.cs (1)
440Options.Create(new MvcDataAnnotationsLocalizationOptions()),
Filters\AntiforgeryApplicationModelProviderTest.cs (6)
18Options.Create(new MvcOptions()), 52Options.Create(new MvcOptions()), 79Options.Create(new MvcOptions()), 103Options.Create(new MvcOptions()), 131Options.Create(new MvcOptions()), 145Options.Create(new MvcOptions()),
Filters\TempDataApplicationModelProviderTest.cs (1)
115Options.Create(new MvcOptions()),
Filters\ViewDataAttributeApplicationModelProviderTest.cs (1)
68Options.Create(new MvcOptions()),
PartialViewResultExecutorTest.cs (1)
358var options = Options.Create(new MvcViewOptions());
PartialViewResultTest.cs (1)
233var options = Options.Create(new MvcViewOptions());
Rendering\DefaultTemplatesUtilities.cs (1)
238var localizationOptionsAccesor = Options.Create(localizationOptions);
Rendering\SystemTextJsonHelperTest.cs (1)
16return new SystemTextJsonHelper(Options.Create(options));
ViewComponentResultTest.cs (1)
664services.AddSingleton(Options.Create(new MvcViewOptions()));
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());
ViewExecutorTest.cs (1)
398Options.Create(new MvcViewOptions()),
ViewResultExecutorTest.cs (1)
348var options = Options.Create(new MvcViewOptions());
ViewResultTest.cs (1)
245var options = Options.Create(new MvcViewOptions());
Microsoft.AspNetCore.OpenApi.Tests (6)
Services\OpenApiDocumentServiceTestsBase.cs (6)
63var optionsAccessor = Options.Create(options); 79Options.Create(routeOptions)); 88var schemaService = new OpenApiSchemaService("Test", Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()), builder.ServiceProvider, openApiOptions.Object); 129var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()); 156new DefaultParameterPolicyFactory(Options.Create(options), new TestServiceProvider()), 327return Options.Create(new RouteHandlerOptions());
Microsoft.AspNetCore.OutputCaching.Tests (5)
TestUtils.cs (5)
98return new OutputCacheKeyProvider(new DefaultObjectPoolProvider(), Options.Create(options)); 211keyProvider = new OutputCacheKeyProvider(new DefaultObjectPoolProvider(), Options.Create(options)); 216Options.Create(options), 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)
RateLimiterApplicationBuilderExtensions.cs (1)
43return app.UseMiddleware<RateLimitingMiddleware>(Options.Create(options));
Microsoft.AspNetCore.RateLimiting.Tests (2)
RateLimitingMetricsTests.cs (1)
346private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
RateLimitingMiddlewareTests.cs (1)
656private IOptions<RateLimiterOptions> CreateOptionsAccessor() => Options.Create(new RateLimiterOptions());
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
22Options.Create(new RequestDecompressionOptions())
Microsoft.AspNetCore.RequestDecompression.Tests (5)
DefaultRequestDecompressionProviderTests.cs (5)
32var options = Options.Create(new RequestDecompressionOptions()); 58var options = Options.Create(new RequestDecompressionOptions()); 85var options = Options.Create(new RequestDecompressionOptions()); 113var options = Options.Create(new RequestDecompressionOptions()); 150var options = Options.Create(new RequestDecompressionOptions());
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
39Options.Create(new ResponseCachingOptions
Microsoft.AspNetCore.ResponseCaching.Tests (3)
TestUtils.cs (3)
113return new ResponseCachingKeyProvider(new DefaultObjectPoolProvider(), Options.Create(options)); 211keyProvider = new ResponseCachingKeyProvider(new DefaultObjectPoolProvider(), Options.Create(options)); 220Options.Create(options),
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
ResponseCompressionProviderBenchmark.cs (1)
25Provider = new ResponseCompressionProvider(services, Options.Create(options));
Microsoft.AspNetCore.Rewrite (1)
RewriteBuilderExtensions.cs (1)
42return AddRewriteMiddleware(app, Options.Create(options));
Microsoft.AspNetCore.Routing.Microbenchmarks (5)
EndpointRoutingShortCircuitBenchmark.cs (2)
35Options.Create(new RouteOptions()), 47Options.Create(new RouteOptions()),
Matching\MatcherBuilderMultipleEntryBenchmark.cs (1)
57_parameterPolicyFactory = new DefaultParameterPolicyFactory(Options.Create(new RouteOptions()), new TestServiceProvider());
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
21_constraintResolver = new DefaultInlineConstraintResolver(Options.Create(routeOptions), new TestServiceProvider());
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
37new DefaultInlineConstraintResolver(Options.Create(routeOptions), new TestServiceProvider()));
Microsoft.AspNetCore.Routing.Tests (12)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1181return Options.Create(RouteHandlerOptions);
DefaultParameterPolicyFactoryTest.cs (1)
414Options.Create(options),
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 });
EndpointRoutingMiddlewareFormOptionsTest.cs (1)
222Options.Create(new RouteOptions()),
EndpointRoutingMiddlewareTest.cs (1)
482Options.Create(new RouteOptions()),
Matching\DfaMatcherBuilderTest.cs (1)
3544Options.Create(new RouteOptions
Matching\RouteMatcherBuilder.cs (1)
21_constraintResolver = new DefaultInlineConstraintResolver(Options.Create(routeOptions), new TestServiceProvider());
Matching\TreeRouterMatcherBuilder.cs (1)
37new DefaultInlineConstraintResolver(Options.Create(routeOptions), new TestServiceProvider()));
RoutingMetricsTests.cs (1)
169Options.Create(new RouteOptions()),
Microsoft.AspNetCore.Security.Microbenchmarks (2)
AuthorizationMiddlewareBenchmark.cs (1)
21var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions()));
AuthorizationPolicyBenchmark.cs (1)
17_policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions()));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (4)
Utilities.cs (4)
115=> new MessagePump(Options.Create(new HttpSysOptions()), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions()))); 121return new MessagePump(Options.Create(options), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions())));
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (4)
Utilities.cs (4)
34=> new MessagePump(Options.Create(new HttpSysOptions()), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions()))); 40return new MessagePump(Options.Create(options), loggerFactory ?? new LoggerFactory(), new AuthenticationSchemeProvider(Options.Create(new AuthenticationOptions())));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
KestrelServerTests.cs (10)
274new KestrelServer(Options.Create<KestrelServerOptions>(null), new MockTransportFactory(), mockLoggerFactory.Object); 283Options.Create<KestrelServerOptions>(null), 307Options.Create<KestrelServerOptions>(options), 574var server = new KestrelServer(Options.Create(options), mockTransportFactory.Object, mockLoggerFactory.Object); 632var server = new KestrelServer(Options.Create(options), mockTransportFactory.Object, mockLoggerFactory.Object); 687var server = new KestrelServer(Options.Create(options), mockTransportFactory.Object, mockLoggerFactory.Object); 822var server = new KestrelServer(Options.Create(options), mockTransportFactory.Object, mockLoggerFactory.Object); 960var server = new KestrelServer(Options.Create(options), mockTransportFactory.Object, mockLoggerFactory.Object); 974return new KestrelServer(Options.Create(options), new MockTransportFactory(), new LoggerFactory(new[] { new KestrelTestLoggerProvider(testLogger) })); 979return new KestrelServer(Options.Create(options), new MockTransportFactory(), new LoggerFactory(new[] { new KestrelTestLoggerProvider(throwOnCriticalErrors) }));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
QuicTestHelpers.cs (1)
44return new QuicTransportFactory(loggerFactory ?? NullLoggerFactory.Instance, Options.Create(quicTransportOptions));
QuicTransportFactoryTests.cs (3)
29var quicTransportFactory = new QuicTransportFactory(NullLoggerFactory.Instance, Options.Create(quicTransportOptions)); 44var quicTransportFactory = new QuicTransportFactory(NullLoggerFactory.Instance, Options.Create(quicTransportOptions)); 61var quicTransportFactory = new QuicTransportFactory(NullLoggerFactory.Instance, Options.Create(quicTransportOptions));
Microsoft.AspNetCore.Session (1)
SessionMiddlewareExtensions.cs (1)
37return app.UseMiddleware<SessionMiddleware>(Options.Create(options));
Microsoft.AspNetCore.Session.Tests (1)
SessionTests.cs (1)
1158_cache = new MemoryDistributedCache(Options.Create(new MemoryDistributedCacheOptions()));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
HubProtocolVersionTests.cs (1)
107Options.Create(new HttpConnectionOptions
Microsoft.AspNetCore.SignalR.Client.Tests (5)
HttpConnectionFactoryTests.cs (3)
32Options.Create(new HttpConnectionOptions 50Options.Create(new HttpConnectionOptions { DefaultTransferFormat = TransferFormat.Text }), 65Options.Create(new HttpConnectionOptions
HubConnectionBuilderTests.cs (2)
30builder.Services.AddSingleton<IConnectionFactory>(new HttpConnectionFactory(Options.Create(new HttpConnectionOptions()), NullLoggerFactory.Instance)); 64builder.Services.AddSingleton<IConnectionFactory>(new HttpConnectionFactory(Options.Create(new HttpConnectionOptions()), NullLoggerFactory.Instance));
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\JsonHubProtocolTests.cs (1)
38return new JsonHubProtocol(Options.Create(protocolOptions));
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
36return new NewtonsoftJsonHubProtocol(Options.Create(protocolOptions));
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
RedisHubLifetimeManagerBenchmark.cs (1)
40var options = Options.Create(new RedisOptions()
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
60public JsonHubProtocol() : this(Options.Create(new JsonHubProtocolOptions()))
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocol.cs (1)
39: this(Options.Create(new MessagePackHubProtocolOptions()))
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
50public NewtonsoftJsonHubProtocol() : this(Options.Create(new NewtonsoftJsonHubProtocolOptions()))
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (4)
RedisHubLifetimeManagerTests.cs (4)
37Options.Create(options), 40new NewtonsoftJsonHubProtocol(Options.Create(jsonOptions)), 41new MessagePackHubProtocol(Options.Create(messagePackOptions)), 104Options.Create(new RedisOptions()
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTests.cs (1)
4482protocol: new NewtonsoftJsonHubProtocol(Options.Create(protocolOptions)),
Microsoft.AspNetCore.StaticFiles (3)
DefaultFilesExtensions.cs (1)
63return app.UseMiddleware<DefaultFilesMiddleware>(Options.Create(options));
DirectoryBrowserExtensions.cs (1)
63return app.UseMiddleware<DirectoryBrowserMiddleware>(Options.Create(options));
StaticFileExtensions.cs (1)
63return app.UseMiddleware<StaticFileMiddleware>(Options.Create(options));
Microsoft.AspNetCore.TestHost (1)
TestServer.cs (1)
71: this(services, featureCollection, Options.Create(new TestServerOptions()))
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddlewareExtensions.cs (1)
47return app.UseMiddleware<WebSocketMiddleware>(Options.Create(options));
Microsoft.Authentication.WebAssembly.Msal (1)
MsalDefaultOptionsConfiguration.cs (1)
46if (string.Equals(name, Options.DefaultName, StringComparison.Ordinal))
Microsoft.Extensions.Compliance.Redaction.Tests (10)
HmacRedactorTest.cs (4)
33var redactor = new HmacRedactor(Microsoft.Extensions.Options.Options.Create(new HmacRedactorOptions 55var redactor = new HmacRedactor(Microsoft.Extensions.Options.Options.Create(new HmacRedactorOptions 70var redactor = new HmacRedactor(Microsoft.Extensions.Options.Options.Create(new HmacRedactorOptions 87Assert.Throws<ArgumentException>(() => new HmacRedactor(Microsoft.Extensions.Options.Options.Create<HmacRedactorOptions>(null!)));
RedactorProviderTests.cs (6)
18options: Microsoft.Extensions.Options.Options.Create(new RedactorProviderOptions())); 30options: Microsoft.Extensions.Options.Options.Create(new RedactorProviderOptions())); 49options: Microsoft.Extensions.Options.Options.Create(opt)); 107options: Microsoft.Extensions.Options.Options.Create<RedactorProviderOptions>(null!))); 115Microsoft.Extensions.Options.Options.Create(new RedactorProviderOptions()))); 132Microsoft.Extensions.Options.Options.Create(opt)));
Microsoft.Extensions.Compliance.Testing (3)
FakeRedactor.cs (2)
41var opt = options ?? Microsoft.Extensions.Options.Options.Create(new FakeRedactorOptions()); 71public static FakeRedactor Create(FakeRedactorOptions? options = null, FakeRedactionCollector? collector = null) => new(Options.Options.Create(options ?? new FakeRedactorOptions()), collector);
FakeRedactorProvider.cs (1)
31_redactor = new FakeRedactor(Options.Options.Create(options ?? new FakeRedactorOptions()), Collector);
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (2)
TelemetryHealthChecksPublisherTests.cs (2)
94var options = Options.Options.Create(new TelemetryHealthCheckPublisherOptions 135Assert.Throws<ArgumentException>(() => new TelemetryHealthCheckPublisher(metrics, logger, Options.Options.Create<TelemetryHealthCheckPublisherOptions>(null!)));
Microsoft.Extensions.Diagnostics.Probes (1)
TcpEndpointProbesExtensions.cs (1)
30return services.AddTcpEndpointProbe(Microsoft.Extensions.Options.Options.DefaultName);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (18)
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());
ResourceMonitoringOptionsCustomValidatorTests.cs (1)
23var tcpStateInfo = new WindowsTcpStateInfo(Options.Options.Create(options));
ResourceMonitoringServiceTests.cs (2)
18using static Microsoft.Extensions.Options.Options; 721Microsoft.Extensions.Options.Options.Create(new ResourceMonitoringOptions()), Array.Empty<IResourceUtilizationPublisher>(), TimeProvider.System);
Windows\Tcp6TableInfoTests.cs (3)
237WindowsTcpStateInfo tcp6TableInfo = new WindowsTcpStateInfo(Options.Options.Create(options)); 253WindowsTcpStateInfo tcp6TableInfo = new WindowsTcpStateInfo(Options.Options.Create(options)); 271WindowsTcpStateInfo tcp6TableInfo = new WindowsTcpStateInfo(Options.Options.Create(options));
Windows\TcpTableInfoTests.cs (3)
180WindowsTcpStateInfo tcpTableInfo = new WindowsTcpStateInfo(Options.Options.Create(options)); 196WindowsTcpStateInfo tcpTableInfo = new WindowsTcpStateInfo(Options.Options.Create(options)); 214WindowsTcpStateInfo tcpTableInfo = new WindowsTcpStateInfo(Options.Options.Create(options));
Windows\WindowsContainerSnapshotProviderTests.cs (1)
331var options = Options.Options.Create<ResourceMonitoringOptions>(new());
Windows\WindowsCountersTests.cs (2)
35var tcpTableInfo = new WindowsTcpStateInfo(Options.Options.Create(options)); 77var tcpTableInfo = new WindowsTcpStateInfo(Options.Options.Create(options));
Windows\WindowsSnapshotProviderTests.cs (1)
33_options = Options.Options.Create<ResourceMonitoringOptions>(new());
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogCollector.cs (1)
46return new FakeLogCollector(Options.Options.Create(Throw.IfNull(options)));
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLogCollectorTests.cs (2)
82var collector = new FakeLogCollector(Microsoft.Extensions.Options.Options.Create(options)); 114Assert.Throws<ArgumentException>(() => new FakeLogCollector(Microsoft.Extensions.Options.Options.Create((FakeLogCollectorOptions)null!)));
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
34: this(environment, applicationLifetime, loggerFactory, optionsAccessor, Options.Options.Create(new WindowsServiceLifetimeOptions()))
Microsoft.Extensions.Http (11)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (9)
105/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 132/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 162/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 277/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 320/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 527/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 569/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 615/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client. 662/// Use <see cref="Options.Options.DefaultName"/> as the name to configure the default client.
HttpClientFactoryExtensions.cs (1)
22return factory.CreateClient(Options.DefaultName);
HttpMessageHandlerFactoryExtensions.cs (1)
22return factory.CreateHandler(Options.DefaultName);
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Logging\HttpClientLoggerTest.cs (5)
309Options.Options.Create( 414var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions()))); 512Options.Options.Create(new FakeLogCollectorOptions()))); 624var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions()))); 894var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions())));
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerExtensions.Obsolete.cs (1)
139string IOptionsChangeTokenSource<ConsoleLoggerOptions>.Name => Options.Options.DefaultName;
Microsoft.Extensions.Options (59)
ConfigureNamedOptions.cs (12)
52/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 55public void Configure(TOptions options) => Configure(Options.DefaultName, options); 112/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 115public void Configure(TOptions options) => Configure(Options.DefaultName, options); 181/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 184public void Configure(TOptions options) => Configure(Options.DefaultName, options); 259/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 262public void Configure(TOptions options) => Configure(Options.DefaultName, options); 346/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 349public void Configure(TOptions options) => Configure(Options.DefaultName, options); 442/// Configures a <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 445public void Configure(TOptions options) => Configure(Options.DefaultName, options);
IOptions.cs (1)
12public interface IOptions<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] out TOptions>
IOptionsFactory.cs (1)
13public interface IOptionsFactory<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions>
IOptionsMonitor.cs (3)
13public interface IOptionsMonitor<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] out TOptions> 16/// Gets the current <typeparamref name="TOptions"/> instance with the <see cref="Options.DefaultName"/>. 23/// <param name="name">The name of the <typeparamref name="TOptions"/> instance. If <see langword="null"/>, <see cref="Options.DefaultName"/>, which is the empty string, is used.</param>
IOptionsMonitorCache.cs (1)
13public interface IOptionsMonitorCache<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions>
IOptionsSnapshot.cs (2)
12public interface IOptionsSnapshot<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] out TOptions> : 19/// <param name="name">The name of the <typeparamref name="TOptions"/> instance. If <see langword="null"/>, <see cref="Options.DefaultName"/>, which is the empty string, is used.</param>
OptionsBuilder.cs (2)
31/// <param name="name">The default name of the <typeparamref name="TOptions"/> instance; if <see langword="null"/>, <see cref="Options.DefaultName"/> is used.</param> 37Name = name ?? Options.DefaultName;
OptionsCache.cs (7)
14public class OptionsCache<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> : 35name ??= Options.DefaultName; 62return GetOrAdd(name, () => localCreateOptions(localName ?? Options.DefaultName, localFactoryArgument)); 67name ?? Options.DefaultName, 80if (_cache.TryGetValue(name ?? Options.DefaultName, out Lazy<TOptions>? lazy)) 100return _cache.TryAdd(name ?? Options.DefaultName, new Lazy<TOptions>( 113_cache.TryRemove(name ?? Options.DefaultName, out _);
OptionsFactory.cs (2)
14public class OptionsFactory<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> : 64else if (name == Options.DefaultName)
OptionsManager.cs (4)
13public class OptionsManager<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> : 33public TOptions Value => Get(Options.DefaultName); 38/// <param name="name">The name of the <typeparamref name="TOptions"/> instance. If <see langword="null"/>, <see cref="Options.DefaultName"/>, which is the empty string, is used.</param> 44name ??= Options.DefaultName;
OptionsMonitor.cs (5)
15public class OptionsMonitor<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> : 66name ??= Options.DefaultName; 79get => Get(Options.DefaultName); 85/// <param name="name">The name of the <typeparamref name="TOptions"/> instance. If <see langword="null"/>, <see cref="Options.DefaultName"/>, which is the empty string, is used.</param> 94string localName = name ?? Options.DefaultName;
OptionsMonitorExtensions.cs (1)
21public static IDisposable? OnChange<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions>(
OptionsServiceCollectionExtensions.cs (5)
50return new OptionsBuilder<TOptions>(services, name ?? Options.Options.DefaultName).ValidateOnStart(); 73return new OptionsBuilder<TOptions>(services, name ?? Options.Options.DefaultName).ValidateOnStart(); 84=> services.Configure(Options.Options.DefaultName, configureOptions); 125=> services.PostConfigure(Options.Options.DefaultName, configureOptions); 268=> services.AddOptions<TOptions>(Options.Options.DefaultName);
OptionsWrapper.cs (1)
12public class OptionsWrapper<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> :
PostConfigureOptions.cs (10)
106/// Configures a <typeparamref name="TOptions"/> instance using the <see cref="Options.DefaultName"/>. 109public void PostConfigure(TOptions options) => PostConfigure(Options.DefaultName, options); 175/// Configures a <typeparamref name="TOptions"/> instance using the <see cref="Options.DefaultName"/>. 178public void PostConfigure(TOptions options) => PostConfigure(Options.DefaultName, options); 253/// Configures a <typeparamref name="TOptions"/> instance using the <see cref="Options.DefaultName"/>. 256public void PostConfigure(TOptions options) => PostConfigure(Options.DefaultName, options); 340/// Configures a <typeparamref name="TOptions"/> instance using the <see cref="Options.DefaultName"/>. 343public void PostConfigure(TOptions options) => PostConfigure(Options.DefaultName, options); 436/// Configures a <typeparamref name="TOptions"/> instance using the <see cref="Options.DefaultName"/>. 439public void PostConfigure(TOptions options) => PostConfigure(Options.DefaultName, options);
UnnamedOptionsManager.cs (2)
9internal sealed class UnnamedOptionsManager<[DynamicallyAccessedMembers(Options.DynamicallyAccessedMembers)] TOptions> : 30return _value ??= _factory.Create(Options.DefaultName);
Microsoft.Extensions.Options.ConfigurationExtensions (4)
ConfigurationChangeTokenSource.cs (2)
23public ConfigurationChangeTokenSource(IConfiguration config) : this(Options.DefaultName, config) 37Name = name ?? Options.DefaultName;
OptionsConfigurationServiceCollectionExtensions.cs (2)
26=> services.Configure<TOptions>(Options.Options.DefaultName, config); 53=> services.Configure<TOptions>(Options.Options.DefaultName, config, configureBinder);
Microsoft.Extensions.Options.Contextual (4)
ContextualOptionsServiceCollectionExtensions.cs (2)
47=> services.Configure(Options.Options.DefaultName, Throw.IfNull(loadOptions)); 80=> services.Configure(Options.Options.DefaultName, Throw.IfNull(configure));
Internal\ContextualOptions.cs (1)
32=> GetAsync(Options.DefaultName, context, cancellationToken);
Internal\ContextualOptionsFactory.cs (1)
68else if (name == Options.DefaultName)
Microsoft.Extensions.Options.Contextual.Tests (1)
ContextualOptionsFactoryTests.cs (1)
157Assert.Equal(new[] { "pre configure" }, await sut.CreateAsync(Options.DefaultName, Mock.Of<IOptionsContext>(), default));
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
39var watcher = new ServiceEndpointWatcher([], NullLogger.Instance, "foo", TimeProvider.System, Options.Options.Create(new ServiceDiscoveryOptions()));
Microsoft.Extensions.Telemetry.Tests (4)
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
RoutingSandbox (1)
HelloExtension\HelloAppBuilderExtensions.cs (1)
15return app.UseMiddleware<HelloMiddleware>(Options.Create(new HelloOptions
RoutingWebSite (1)
HelloExtension\HelloAppBuilderExtensions.cs (1)
15return app.UseMiddleware<HelloMiddleware>(Options.Create(new HelloOptions
Sockets.BindTests (1)
SocketTransportFactoryTests.cs (1)
20var socketTransportFactory = new SocketTransportFactory(Options.Create(new SocketTransportOptions()), new LoggerFactory());