Command and Query Flow
Summary
Minimal API delegates resolve scoped services directly; MediatR and a separate handler pipeline are absent.
Audience
Backend and frontend developers, QA and DevOps engineers, support and security engineers, and solution architects.
Overview
Minimal API delegates resolve scoped services directly; MediatR and a separate handler pipeline are absent.
Technical Detail
Command flow
A minimal API parses input, resolves an application service through dependency injection, invokes imperative validation/orchestration, loads and mutates records, stages audit/outbox evidence, saves, and maps a response DTO.
Query flow
A minimal API forwards filters to an application service, which performs tenant-scoped asynchronous EF Core queries and returns projected DTOs or generated bytes. Some output queries persist an access audit after reading.
Handler and validation model
There is no MediatR reference, request-handler hierarchy, pipeline behavior, or FluentValidation registration. Error/result behavior is endpoint-specific and Transitional.
Source References
microservices/src/payroll-service/Api/PayrollRunEndpoints.csmicroservices/src/payroll-service/Api/PayrollOutputEndpoints.csmicroservices/src/payroll-service/Application/PayrollCalculationService.csmicroservices/src/payroll-service/Application/PayrollOutputsService.cs
Related Articles
See Also
Keywords
- Payroll Service
- Command and Query Flow
- Technical architecture
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly