ITLab.Template.DevPack.Dtos
Contains neutral infrastructure DTOs used by options binding, scheduling, caching and messaging.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Abstract Class | BaseKeyValueDto<TValue> | Base key-label payload with optional object metadata |
| Abstract Class | BaseKeyValueDto<TValue, TAdditional> | Base key-label payload with typed metadata |
| Class | OptionDto<TValue> | Specialization of BaseKeyValueDto<TValue> for UI option payloads |
| Class | OptionDto<TValue, TAdditional> | Strongly typed option DTO with typed metadata |
| Class | GenericKeyValueDto<TValue> | Concrete key-value DTO with object metadata |
| Class | GenericKeyValueDto<TValue, TAdditional> | Concrete key-value DTO with typed metadata |
| Class | CachedKey | Cache key diagnostics model |
| Record | EmailAttachment | Binary email attachment representation |
| Record | EmailResult | Outcome of an email send operation (Success, MessageId, ErrorMessage) |
| Class | NotificationRecipientDto | Recipient target for notifications |
| Class | ScheduledJobConfig | Scheduler binding model (lives in ScheduledJobConfiguration.cs) |
| Class | StorageConfiguration | Shared storage configuration contract |
| Class | NameValue | String-based name/value pair (specialization of NameValue<string>) |
| Class | NameValue<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
BaseKeyValueDtospecializations to add typed metadata for UI integrations. - Products can extend scheduled job settings via
ScheduledJobConfig.Settingsusing stable, serializable keys.