Class RedisSettingsValidator
- Namespace
- SEBT.Portal.Infrastructure.Configuration.Validators
- Assembly
- SEBT.Portal.Infrastructure.dll
Rejects a Redis section that is incomplete, contradictory, or unsafe for the environment.
Redis is optional: without Redis:Host the portal falls back to in-memory caching and SQL
Server locks. Blanking the host over a state file that configures TLS Redis is how a
single-instance stack turns Redis off, so a section without a host is not checked. Once a host is
set, the TLS values have to agree with each other, and certificate validation may only be skipped
in Development.
ResolveRedisConfigurationOptions runs this too: it reads the section while services are still
being registered, before validate-on-start can see it.
public class RedisSettingsValidator
- Inheritance
-
objectRedisSettingsValidator
Constructors
RedisSettingsValidator(IHostEnvironment)
Rejects a Redis section that is incomplete, contradictory, or unsafe for the environment.
Redis is optional: without Redis:Host the portal falls back to in-memory caching and SQL
Server locks. Blanking the host over a state file that configures TLS Redis is how a
single-instance stack turns Redis off, so a section without a host is not checked. Once a host is
set, the TLS values have to agree with each other, and certificate validation may only be skipped
in Development.
ResolveRedisConfigurationOptions runs this too: it reads the section while services are still
being registered, before validate-on-start can see it.
public RedisSettingsValidator(IHostEnvironment environment)
Parameters
environmentIHostEnvironment
Methods
Validate(string?, RedisSettings)
Validates a specified named options instance (or all if name is null).
public ValidateOptionsResult Validate(string? name, RedisSettings options)
Parameters
namestringThe name of the options instance being validated.
optionsRedisSettingsThe options instance.
Returns
- ValidateOptionsResult
The Microsoft.Extensions.Options.ValidateOptionsResult result.