Overview of Custom DTOs in Coalesce
Custom DTOs allow developers to create a custom implementation of IClassDto with specific properties, exposing it as a first-class CRUD Model type. They support all standard CRUD Model features but require manual mapping logic.
When to use Custom DTOs vs Standalone Entities:
- Use Custom DTOs when: You need complex mapping logic that is difficult to represent in an EF query expression, or you want to perform Create/Update/Delete operations without writing a separate Behaviors class.
- Use Standalone Entities when: You need a read-only use case, need to base the model on multiple EF Entities, or require property-level Security Attributes and
[DtoIncludes]/[DtoExcludes](which Custom DTOs do not support natively).