Concepts
Pragmatic.Attachments is a trait package for parent-child file metadata.
Mental Model
Section titled “Mental Model”The parent entity stays your domain aggregate. The generated attachment entity stores metadata about files associated with that parent:
- original file name
- content type
- size
- storage URI
- uploader and timestamps
The actual file bytes live in Pragmatic.Storage, not in the attachment entity itself.
Generated Shape
Section titled “Generated Shape”From a single [HasAttachments], the consuming project gets:
- a typed
{Parent}Attachmententity - EF configuration and FK
- actions for upload, download, and delete
- attachment endpoints under the parent resource
- a navigation collection on the parent
Dependency Model
Section titled “Dependency Model”The trait relies on other Pragmatic building blocks for different concerns:
Pragmatic.Persistencefor entity shape and EF integrationPragmatic.Storagefor physical file storagePragmatic.Endpointsfor generated HTTP endpoints