From e3671aeeab5f1cdb6c3a7f423216176429024612 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 5 Nov 2018 13:04:25 -0800 Subject: [PATCH] [WIP] Update options for 2.2 WIP (switching browsers) not ready for review --- aspnetcore/fundamentals/configuration/options.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aspnetcore/fundamentals/configuration/options.md b/aspnetcore/fundamentals/configuration/options.md index 67d77d7649a2..86e756799c64 100644 --- a/aspnetcore/fundamentals/configuration/options.md +++ b/aspnetcore/fundamentals/configuration/options.md @@ -269,6 +269,18 @@ named_options_2: option1 = ConfigureAll replacement value, option2 = 5 ::: moniker range=">= aspnetcore-2.2" +## OptionsBuilder API + +`OptionsBuilder` was introduced in 2.1 to consolidate the options API instead of continuing to add extension methods to `IServiceCollection`. This also simplifies dealing with named options as its only a single parameter to the initial `AddOptions(string optionsName)` call instead of sprinkled in all of the subsequent calls. Note: Options validation and the `ConfigureOptions` overloads that accept service dependencies only are availabe via `OptionsBuilder` + +``` + // Add example +``` + +## `ConfigureOptions` + +TBD + ## Options validation Options validation allows you to validate options when options are configured. Call `Validate` with a validation method that returns `true` if options are valid and `false` if they aren't valid: