Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 999 Bytes

File metadata and controls

15 lines (11 loc) · 999 Bytes

.NET

OptionsPatternDemo

Using options pattern in web api

In this demo, i m using OptionsPattern (IOptions, IOptionsMonitor and IOptionsSnapshot) to read settings from configuration file.

The strategy is enabled by setting the choice query parameter to :

  • ConfigurationOptionsService : for reading values once at the startup (reload configuration only after startup)
  • ConfigurationOptionsMonitorService : for reading always new values (reload configuration in every usage even in the same request)
  • ConfigurationOptionsSnapshotService : for reading new values for each new request (reload configuration in every new request)

Tools : net 8.0, integration-tests