Generate CRUD Operations
Generate Controller, Service, Repository, DTO, and Tests for an entity.
What To Do
- Analyze existing patterns: Read an existing entity implementation to match conventions.
- Generate files:
- Controller with GET (all, by id), POST, PUT, DELETE endpoints
- Service interface + implementation with validation
- Repository interface + implementation (CosmosDB)
- DTO with ToDomain() and FromDomain() static methods
- Unit tests for service layer
- Register in DI: Add service and repository to Program.cs
Arguments
<entity-name>: Entity name in PascalCase--with-tests: Generate test file (default: true)--with-dto: Generate DTO classes (default: true)