ValidateOnStart
The options-builder call that makes the host validate options while starting and refuse to start if they are invalid.
In more detail
It turns a bad setting into a failed deployment rather than a failed request hours later. The failure is an OptionsValidationException naming the class, member and rule.
Related terms
- AddOptions — The registration call, services.AddOptions<T>(), that returns an options builder on which binding and validation calls are chained.
- OptionsValidationException — The .NET exception thrown when options fail validation, naming the options class, the failing member and the error.
- ValidateDataAnnotations — The options-builder call that checks a bound options object against the data annotation attributes on its properties.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices