-
Notifications
You must be signed in to change notification settings - Fork 67
Conversation
The feature looks generally useful. What's the need for 2.2? Which components are going to use it? |
@davidfowl Let's discuss in the leads sync today. |
There isn't an explicit need for this in 2.2 as opposed to 3.0, Security/Auth would probably want to switch to using this in some form to validate options. The other thing that we should try to tackle as part of this is enabling some way to trigger validation at startup instead of on first use, maybe via IStartupFilter like this blog post: https://andrewlock.net/adding-validation-to-strongly-typed-configuration-objects-in-asp-net-core/ |
Addresses dotnet/aspnetcore#2388 which I've moved into 2.2 |
Gonna put this into 2.2, and look at triggering start up validation in a separate PR |
@davidfowl @HaoK It's neat, is there a suggestion about any MVC features where we'd use it? |
Adds the ability to validate options via a new
IValidateOptions
interface that theIOptionsFactory
consumes if registered:General use case looks like this and is only exposed off of the
OptionsBuilder
:Thoughts @davidfowl ?
I've already gone over the general idea with @ajcvickers and we think it looks promising.