Skip to content

Common Mistakes

1. Forgetting to configure a storage provider

Section titled “1. Forgetting to configure a storage provider”

The trait stores metadata, but file bytes still need Pragmatic.Storage.

Without [Entity<TId>], the generator cannot infer the parent id type for the FK.

3. Missing [Resource] and expecting endpoints anyway

Section titled “3. Missing [Resource] and expecting endpoints anyway”

The trait can still generate entity and action artifacts, but endpoint generation depends on route metadata from the parent resource.

4. Expecting file bytes in the database entity

Section titled “4. Expecting file bytes in the database entity”

The generated attachment type stores StorageUri and metadata, not the binary payload.

5. Using a restrictive extension list and forgetting the leading dot

Section titled “5. Using a restrictive extension list and forgetting the leading dot”

Prefer .pdf,.jpg over pdf,jpg to match the package’s documented extension format.