ITLab.Template.DevPack.AppSettings
Centralizes strongly typed option models for cross-cutting infrastructure features.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Class | ApplicationOptions | App metadata, frontend URL and CORS origins |
| Class | CacheOptions | Cache expiration defaults |
| Class | ConnectionStrings | Infrastructure connection strings |
| Class | JwtOptions | JWT issuance settings |
| Class | LdapOptions | LDAP integration settings |
| Class | LoggerOptions | Logging provider behavior |
| Class | MicrosoftEntraIdOptions | Entra authentication settings |
| Class | ScheduledJobsOptions | Scheduler global settings and job list |
| Class | ServiceBusOptions | Service Bus namespace settings |
| Class | SignalROptions | SignalR endpoint settings |
Como usar
// Strongly typed options registration with section path from each model.
services.AddOptions<ApplicationOptions>()
.BindConfiguration(ApplicationOptions.ConfigSectionPath)
.ValidateOnStart();
services.AddOptions<JwtOptions>()
.BindConfiguration(JwtOptions.ConfigSectionPath)
.ValidateOnStart();
O que não fazer
- Do not mutate options classes at runtime to carry request-specific state.
- Do not keep production defaults permissive (for example wildcard CORS fallback).
Extensão pelo produto
- Products can add product-specific option classes implementing
IAppOptions. - Products should keep section names stable to avoid deployment regressions.