35 implementations of IValidateOptions
Aspire.Dashboard (1)
Configuration\ValidateDashboardOptions.cs (1)
10public sealed class ValidateDashboardOptions : IValidateOptions<DashboardOptions>
Aspire.Hosting (3)
Dashboard\DashboardOptions.cs (1)
37internal class ValidateDashboardOptions : IValidateOptions<DashboardOptions>
Dashboard\ResourceServiceOptions.cs (1)
42internal sealed class ValidateResourceServiceOptions : IValidateOptions<ResourceServiceOptions>
Dcp\DcpOptions.cs (1)
80internal class ValidateDcpOptions : IValidateOptions<DcpOptions>
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Latency\RequestLatencyTelemetryOptionsValidator.cs (1)
9internal sealed partial class RequestLatencyTelemetryOptionsValidator : IValidateOptions<RequestLatencyTelemetryOptions>
Logging\LoggingRedactionOptionsValidator.cs (1)
11internal sealed partial class LoggingRedactionOptionsValidator : IValidateOptions<LoggingRedactionOptions>
Logging\RequestHeadersLogEnricherOptionsValidator.cs (1)
9internal sealed partial class RequestHeadersLogEnricherOptionsValidator : IValidateOptions<RequestHeadersLogEnricherOptions>
Microsoft.AspNetCore.HeaderParsing (2)
HeaderParsingOptionsManualValidator.cs (1)
8internal sealed class HeaderParsingOptionsManualValidator : IValidateOptions<HeaderParsingOptions>
HeaderParsingOptionsValidator.cs (1)
9internal sealed partial class HeaderParsingOptionsValidator : IValidateOptions<HeaderParsingOptions>
Microsoft.Extensions.AmbientMetadata.Application (1)
ApplicationMetadataValidator.cs (1)
9internal sealed partial class ApplicationMetadataValidator : IValidateOptions<ApplicationMetadata>
Microsoft.Extensions.Compliance.Redaction (1)
HmacRedactorOptionsValidator.cs (1)
9internal sealed partial class HmacRedactorOptionsValidator : IValidateOptions<HmacRedactorOptions>
Microsoft.Extensions.Compliance.Testing (2)
FakeRedactorOptionsAutoValidator.cs (1)
9internal sealed partial class FakeRedactorOptionsAutoValidator : IValidateOptions<FakeRedactorOptions>
FakeRedactorOptionsCustomValidator.cs (1)
10internal sealed class FakeRedactorOptionsCustomValidator : IValidateOptions<FakeRedactorOptions>
Microsoft.Extensions.Diagnostics.Probes (2)
KubernetesProbesOptionsValidator.cs (1)
8internal sealed class KubernetesProbesOptionsValidator : IValidateOptions<KubernetesProbesOptions>
TcpEndpointProbesOptionsValidator.cs (1)
9internal sealed partial class TcpEndpointProbesOptionsValidator : IValidateOptions<TcpEndpointProbesOptions>
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
ResourceMonitoringOptionsCustomValidator.cs (1)
10internal sealed class ResourceMonitoringOptionsCustomValidator : IValidateOptions<ResourceMonitoringOptions>
ResourceMonitoringOptionsValidator.cs (1)
9internal sealed partial class ResourceMonitoringOptionsValidator : IValidateOptions<ResourceMonitoringOptions>
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\LoggingOptionsValidator.cs (1)
9internal sealed partial class LoggingOptionsValidator : IValidateOptions<LoggingOptions>
Microsoft.Extensions.Http.Resilience (6)
Hedging\Internals\Validators\HttpStandardHedgingResilienceOptionsCustomValidator.cs (1)
9internal sealed class HttpStandardHedgingResilienceOptionsCustomValidator : IValidateOptions<HttpStandardHedgingResilienceOptions>
Hedging\Internals\Validators\HttpStandardHedgingResilienceOptionsValidator.cs (1)
9internal sealed partial class HttpStandardHedgingResilienceOptionsValidator : IValidateOptions<HttpStandardHedgingResilienceOptions>
Resilience\Internal\Validators\HttpStandardResilienceOptionsCustomValidator.cs (1)
9internal sealed class HttpStandardResilienceOptionsCustomValidator : IValidateOptions<HttpStandardResilienceOptions>
Resilience\Internal\Validators\HttpStandardResilienceOptionsValidator.cs (1)
9internal sealed partial class HttpStandardResilienceOptionsValidator : IValidateOptions<HttpStandardResilienceOptions>
Routing\Internal\OrderedGroups\OrderedGroupsRoutingOptionsValidator.cs (1)
9internal sealed partial class OrderedGroupsRoutingOptionsValidator : IValidateOptions<OrderedGroupsRoutingOptions>
Routing\Internal\WeightedGroups\WeightedGroupsRoutingOptionsValidator.cs (1)
9internal sealed partial class WeightedGroupsRoutingOptionsValidator : IValidateOptions<WeightedGroupsRoutingOptions>
Microsoft.Extensions.Options (6)
ValidateOptions.cs (6)
12public class ValidateOptions<TOptions> : IValidateOptions<TOptions> where TOptions : class 72public class ValidateOptions<TOptions, TDep> : IValidateOptions<TOptions> where TOptions : class 140public class ValidateOptions<TOptions, TDep1, TDep2> : IValidateOptions<TOptions> where TOptions : class 216public class ValidateOptions<TOptions, TDep1, TDep2, TDep3> : IValidateOptions<TOptions> where TOptions : class 300public class ValidateOptions<TOptions, TDep1, TDep2, TDep3, TDep4> : IValidateOptions<TOptions> where TOptions : class 392public class ValidateOptions<TOptions, TDep1, TDep2, TDep3, TDep4, TDep5> : IValidateOptions<TOptions> where TOptions : class
Microsoft.Extensions.Options.DataAnnotations (1)
DataAnnotationValidateOptions.cs (1)
20: IValidateOptions<TOptions> where TOptions : class
Microsoft.Extensions.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProviderOptionsValidator.cs (1)
8internal sealed class ConfigurationServiceEndpointProviderOptionsValidator : IValidateOptions<ConfigurationServiceEndpointProviderOptions>
Internal\ServiceDiscoveryOptionsValidator.cs (1)
8internal sealed class ServiceDiscoveryOptionsValidator : IValidateOptions<ServiceDiscoveryOptions>
Microsoft.Extensions.Telemetry (1)
Logging\LoggerEnrichmentOptionsValidator.cs (1)
9internal sealed partial class LoggerEnrichmentOptionsValidator : IValidateOptions<LoggerEnrichmentOptions>
Microsoft.Extensions.Telemetry.Abstractions (1)
Latency\Registration\LatencyContextRegistrationOptionsValidator.cs (1)
9internal sealed partial class LatencyContextRegistrationOptionsValidator : IValidateOptions<LatencyContextRegistrationOptions>
61 references to IValidateOptions
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
163builder.Services.AddSingleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>();
Aspire.Hosting (6)
Dashboard\DashboardServiceHost.cs (1)
82builder.Services.AddSingleton<IValidateOptions<ResourceServiceOptions>, ValidateResourceServiceOptions>();
Dashboard\TransportOptionsValidator.cs (1)
10internal class TransportOptionsValidator(IConfiguration configuration, DistributedApplicationExecutionContext executionContext, DistributedApplicationOptions distributedApplicationOptions) : IValidateOptions<TransportOptions>
DistributedApplicationBuilder.cs (4)
270_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TransportOptions>, TransportOptionsValidator>()); 276_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>()); 284_innerBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<DcpOptions>, ValidateDcpOptions>()); 317_innerBuilder.Services.AddSingleton<IValidateOptions<HealthCheckServiceOptions>>(sp =>
Aspire.StackExchange.Redis (1)
AspireRedisExtensions.cs (1)
202public ConfigurationOptionsFactory(IServiceProvider serviceProvider, IEnumerable<IConfigureOptions<ConfigurationOptions>> setups, IEnumerable<IPostConfigureOptions<ConfigurationOptions>> postConfigures, IEnumerable<IValidateOptions<ConfigurationOptions>> validations)
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactor.cs (1)
43IValidateOptions<FakeRedactorOptions> validator = new FakeRedactorOptionsAutoValidator();
Microsoft.Extensions.Options (34)
IStartupValidator.cs (2)
15/// Calls the <see cref="IValidateOptions{TOptions}"/> validators. 17/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating.</exception>
OptionsBuilder.cs (6)
356Services.AddSingleton<IValidateOptions<TOptions>>(new ValidateOptions<TOptions>(Name, validation, failureMessage)); 380Services.AddTransient<IValidateOptions<TOptions>>(sp => 411Services.AddTransient<IValidateOptions<TOptions>>(sp => 450Services.AddTransient<IValidateOptions<TOptions>>(sp => 494Services.AddTransient<IValidateOptions<TOptions>>(sp => 543Services.AddTransient<IValidateOptions<TOptions>>(sp =>
OptionsFactory.cs (7)
20private readonly IValidateOptions<TOptions>[] _validations; 27public OptionsFactory(IEnumerable<IConfigureOptions<TOptions>> setups, IEnumerable<IPostConfigureOptions<TOptions>> postConfigures) : this(setups, postConfigures, validations: Array.Empty<IValidateOptions<TOptions>>()) 36public OptionsFactory(IEnumerable<IConfigureOptions<TOptions>> setups, IEnumerable<IPostConfigureOptions<TOptions>> postConfigures, IEnumerable<IValidateOptions<TOptions>> validations) 45_validations = validations as IValidateOptions<TOptions>[] ?? new List<IValidateOptions<TOptions>>(validations).ToArray(); 53/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception> 77foreach (IValidateOptions<TOptions> validate in _validations)
OptionsManager.cs (1)
40/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsMonitor.cs (2)
75/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception> 87/// <exception cref="OptionsValidationException">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsServiceCollectionExtensions.cs (7)
60/// <typeparam name="TValidateOptions">The <see cref="IValidateOptions{TOptions}"/> validator type.</typeparam> 70where TValidateOptions : class, IValidateOptions<TOptions> 72services.AddOptions().TryAddEnumerable(ServiceDescriptor.Singleton<IValidateOptions<TOptions>, TValidateOptions>()); 160/// <see cref="IPostConfigureOptions{TOptions}"/>, and <see cref="IValidateOptions{TOptions}"/> 180gtd == typeof(IValidateOptions<>)) 206/// <see cref="IPostConfigureOptions{TOptions}"/>, and <see cref="IValidateOptions{TOptions}"/> 235/// <see cref="IPostConfigureOptions{TOptions}"/>, and <see cref="IValidateOptions{TOptions}"/>
OptionsValidatorAttribute.cs (1)
10/// Triggers the automatic generation of the implementation of <see cref="Microsoft.Extensions.Options.IValidateOptions{T}" /> at compile time.
ValidateEnumeratedItemsAttribute.cs (1)
30/// <param name="validator">A type that implements <see cref="IValidateOptions{T}" /> for the enumerable's type.</param>
ValidateObjectMembersAttribute.cs (1)
29/// <param name="validator">A type that implements <see cref="IValidateOptions{T}" /> for the field/property's type.</param>
ValidateOptions.cs (6)
9/// Implementation of <see cref="IValidateOptions{TOptions}"/> 68/// Implementation of <see cref="IValidateOptions{TOptions}"/> 135/// Implementation of <see cref="IValidateOptions{TOptions}"/>. 210/// Implementation of <see cref="IValidateOptions{TOptions}"/> 293/// Implementation of <see cref="IValidateOptions{TOptions}"/> 384/// Implementation of <see cref="IValidateOptions{TOptions}"/>
Microsoft.Extensions.Options.Contextual (4)
Internal\ContextualOptionsFactory.cs (4)
28private readonly IValidateOptions<TOptions>[] _validations; 41IEnumerable<IValidateOptions<TOptions>> validations) 46_validations = validations as IValidateOptions<TOptions>[] ?? validations.ToArray(); 135foreach (IValidateOptions<TOptions> validate in _validations)
Microsoft.Extensions.Options.Contextual.Tests (10)
ContextualOptionsFactoryTests.cs (10)
27Enumerable.Empty<IValidateOptions<List<string>>>()); 74Enumerable.Empty<IValidateOptions<List<string>>>()); 95Enumerable.Empty<IValidateOptions<List<string>>>())); 115Enumerable.Empty<IValidateOptions<List<string>>>()); 128Enumerable.Empty<IValidateOptions<List<string>>>()); 141Enumerable.Empty<IValidateOptions<List<string>>>()); 154Enumerable.Empty<IValidateOptions<List<string>>>()); 198Enumerable.Empty<IValidateOptions<List<string>>>()); 220Enumerable.Empty<IValidateOptions<List<string>>>()); 245Enumerable.Empty<IValidateOptions<List<string>>>());
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (1)
16/// Implementation of <see cref="IValidateOptions{TOptions}"/> that uses DataAnnotation's <see cref="Validator"/> for validation.
OptionsBuilderDataAnnotationsExtensions.cs (1)
24optionsBuilder.Services.AddSingleton<IValidateOptions<TOptions>>(new DataAnnotationValidateOptions<TOptions>(optionsBuilder.Name));
Microsoft.Extensions.ServiceDiscovery (2)
ServiceDiscoveryServiceCollectionExtensions.cs (2)
63services.TryAddTransient<IValidateOptions<ServiceDiscoveryOptions>, ServiceDiscoveryOptionsValidator>(); 97services.AddTransient<IValidateOptions<ConfigurationServiceEndpointProviderOptions>, ConfigurationServiceEndpointProviderOptionsValidator>();