Every layer of this feature — entity, event, event handler, CRUD requests, queries, endpoint routes, DTO — is hand-written. No
[RaisesEvent],[CrudCreate]/[CrudUpdate], or[GenerateDto]attribute is used anywhere in it.
This sample implements the full vertical-slice pattern by hand, from entity to endpoint. It shows:
PurchaseOrder aggregate that raises its own creation event via AddEvent.For the line-by-line trade-off against the automated sample, see
docs/samples/manual-vs-automated.md.
Base path /v1/purchase-orders:
| Route | Notes |
|---|---|
POST / |
Requires X-Idempotency-Key: {Guid} header — a replayed key returns the original response instead of creating a duplicate. |
GET / |
Paged, optional CustomerName filter. |
GET /{id} |
404 on unknown id. |
PUT /{id} |
Changes Amount; 404 on unknown id. |
POST /{id}/cancel |
400 if already cancelled. |
DELETE /{id} |
404 on unknown id. |
.RequiredIdempotentKey() on the create route.PurchaseOrderStaticData, discovered by
UseAutoDataSeeding and visible over GET /v1/purchase-orders on a fresh database.It does not carry external broker publish/subscribe. Its domain event stays on the in-memory bus only; see the automated sample for that capability.
Remove src/ApiEndpoints/**/ManualSample/**, src/ApiEndpoints/Minimal.Api/ApiEndpoints/ManualSample/,
and this docs/samples/manual-purchase-orders/ folder. Then drop its EF Core mapping/seed classes
from the next migration. No other feature depends on it.