472 B
472 B
Command Design
Design effective commands for CQRS.
Best Practices
✅ DO
- Use records for immutability
- Include all required data
- Validate at boundaries
- Use descriptive names
- Make commands self-contained
❌ DON'T
- Don't query in commands
- Don't expose domain models
- Don't make commands mutable
- Don't use DTOs as commands