Pular para o conteúdo principal
Versão: main (dev) 🚧

ITLab.Template.DevPack.Dtos

Contains neutral infrastructure DTOs used by options binding, scheduling, caching and messaging.

Componentes

TipoNomeResponsabilidade
Abstract ClassBaseKeyValueDto<TValue>Base key-label payload with optional object metadata
Abstract ClassBaseKeyValueDto<TValue, TAdditional>Base key-label payload with typed metadata
ClassOptionDto<TValue>Specialization of BaseKeyValueDto<TValue> for UI option payloads
ClassOptionDto<TValue, TAdditional>Strongly typed option DTO with typed metadata
ClassGenericKeyValueDto<TValue>Concrete key-value DTO with object metadata
ClassGenericKeyValueDto<TValue, TAdditional>Concrete key-value DTO with typed metadata
ClassCachedKeyCache key diagnostics model
RecordEmailAttachmentBinary email attachment representation
RecordEmailResultOutcome of an email send operation (Success, MessageId, ErrorMessage)
ClassNotificationRecipientDtoRecipient target for notifications
ClassScheduledJobConfigScheduler binding model (lives in ScheduledJobConfiguration.cs)
ClassStorageConfigurationShared storage configuration contract
ClassNameValueString-based name/value pair (specialization of NameValue<string>)
ClassNameValue<T>Generic name/typed-value pair

Como usar

// Scheduler options are bound from configuration and validated at startup.
services.AddOptions<ScheduledJobsOptions>()
.BindConfiguration(ScheduledJobsOptions.ConfigSectionPath)
.ValidateDataAnnotations();

// Example DTO payload for UI options.
var statusOptions = new[]
{
new OptionDto<int>(1, "Active"),
new OptionDto<int>(2, "Inactive")
};

O que não fazer

  • Do not include domain rules inside DTO constructors.
  • Do not store runtime state in DTOs expected to be configuration snapshots.

Extensão pelo produto

  • Products can inherit BaseKeyValueDto specializations to add typed metadata for UI integrations.
  • Products can extend scheduled job settings via ScheduledJobConfig.Settings using stable, serializable keys.