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

ITLab.Template.DevPack.Attributes

Provides custom attributes for metadata decoration, behavior configuration and pipeline integration.

Componentes

TipoNomeResponsabilidade
AttributeAdditionalAttributeAttaches free-form metadata strings to any annotated target
AttributeDisableIdGenerationAttributeSuppresses automatic ID generation for the annotated entity or property
AttributeErrorCatalogAttributeMaps a type or member to a named error catalog entry
AttributeNotifyAttributeSignals that the annotated member should trigger a notification when changed

Como usar

// Suppress auto ID generation on an entity.
[DisableIdGeneration]
public sealed class ExternalIntegrationRecord : Entity<string> { }

Mudanças na 10.2.0

  • Removido NormalizeDateTimeOffsetAttribute. Era consumido pelo NormalizeDateTimeOffsetBehavior, também removido. Com AuditedEntity migrada para DateTime UTC + LocalTimeZone, o pipeline de normalização perdeu razão de existir.

O que não fazer

  • Do not add business logic inside attribute constructors.
  • Do not use AdditionalAttribute as a replacement for strongly typed metadata.

Extensão pelo produto

  • Products can combine ErrorCatalogAttribute with error catalog resolvers to surface localized messages.