Table of Contents

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
object
RedisSettingsValidator

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

environment IHostEnvironment

Methods

Validate(string?, RedisSettings)

Validates a specified named options instance (or all if name is null).

public ValidateOptionsResult Validate(string? name, RedisSettings options)

Parameters

name string

The name of the options instance being validated.

options RedisSettings

The options instance.

Returns

ValidateOptionsResult

The Microsoft.Extensions.Options.ValidateOptionsResult result.