https://github.com/aimenux/optionspatterndemo
Using options pattern in web api
https://github.com/aimenux/optionspatterndemo
net80 options-pattern web-api
Last synced: 3 months ago
JSON representation
Using options pattern in web api
- Host: GitHub
- URL: https://github.com/aimenux/optionspatterndemo
- Owner: aimenux
- License: mit
- Created: 2019-05-30T14:32:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T11:07:13.000Z (12 months ago)
- Last Synced: 2025-01-10T00:24:38.482Z (4 months ago)
- Topics: net80, options-pattern, web-api
- Language: C#
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/aimenux/ReloadConfigChangesDemo/actions/workflows/ci.yml)
# OptionsPatternDemo
```
Using options pattern in web api
```In this demo, i m using [OptionsPattern](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-8.0#options-interfaces) (`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