Clean Architecture CQRS — FluentValidation & Pipeline Behavior (Final Part)

Опубликовано: 27 Июль 2026
на канале: Real World Devs
1,274
19

The final piece: automatic request validation with FluentValidation integrated into the MediatR pipeline. In Part 10, I add validation behavior that validates every command and query before it reaches your handlers.

⏱ Timestamps:
0:00 - Final session introduction
1:44 - FluentValidation for command validation
2:41 - Creating pipeline behavior (generic validator)
5:26 - RequestValidationBehavior{TRequest, TResponse}
8:00 - Registering validators in DI container
10:33 - Testing validation errors with Swagger
12:38 - Series wrap-up & conclusion

✅ Full CRUD API with:
✓ Clean Architecture layers
✓ CQRS pattern (Commands + Queries)
✓ MediatR pipeline
✓ EF Core + SQLite
✓ FluentValidation

📦 Full CQRS Series:
▶ Part 1: Overview →    • Clean Architecture with CQRS and MediatR —...  
▶ Part 2: Project Setup →    • Clean Architecture CQRS — Project Setup, M...  
▶ Part 3: Domain Layer →    • Clean Architecture CQRS — Domain Layer: En...  
▶ Part 4: Application Layer →    • CQRS Clean Architecture — Application Laye...  
▶ Part 5: Infrastructure →    • Clean Architecture CQRS — Infrastructure L...  
▶ Part 6: HttpGet →    • Clean Architecture CQRS — Web API HttpGet:...  
▶ Part 7: HttpPost →    • Clean Architecture CQRS — Web API HttpPost...  
▶ Part 8: HttpPut →    • Clean Architecture CQRS — Web API HttpPut:...  
▶ Part 9: HttpDelete →    • Clean Architecture CQRS — Web API HttpDele...  
▶ Part 10: Validation (You're here ✅)

🔗 Source Code: https://github.com/kartik786-git/Clea...

#FluentValidation #CQRS #CleanArchitecture