Pular para o conteúdo principal
Versão: 10.4.1

ITLab.Template.DevPack.AppSettings

Centralizes strongly typed option models for cross-cutting infrastructure features.

Componentes

TipoNomeResponsabilidade
ClassApplicationOptionsApp metadata, frontend URL and CORS origins
ClassCacheOptionsCache expiration defaults
ClassConnectionStringsInfrastructure connection strings
ClassJwtOptionsJWT issuance settings
ClassLdapOptionsLDAP integration settings
ClassLoggerOptionsLogging provider behavior
ClassMicrosoftEntraIdOptionsEntra authentication settings
ClassScheduledJobsOptionsScheduler global settings and job list
ClassServiceBusOptionsService Bus namespace settings
ClassSignalROptionsSignalR 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.