This ASP.NET web application serves as an example of how to use the MediatR framework.
Separate branch with the .NET Core 2.2 version.
Supports request/response, commands, queries, notifications and events, sync and async with intelligent dispatching via C# generic variance.
If you are familiar with Command Query Responsibility Segregation (CQRS), you will find a common ground.
- FluentValidation to validate the MediatR pipeline
- Pipeline validation with FluentValidation 📓CodeMaze
- To achieve model validation in the MediatR pipeline (instead of in the APIController), you need to disable the built-in automatic model state validation.
- Custom error handling
- Using IRequestExceptionHandler in MediatR requests 📓CodeMaze
- Translating exceptions into Problem Details responses 📓Tim Deschryver
- Creating a custom ErrorHandlerMiddleware function 📓AndrewLock
- Global Error Handling in ASP.NET Core Web API 📓CodeMaze
- New way in ASP.NET 8 using IExceptionHandler 📓Milan's newsletter
- Entity Framework Core 📚
- 📓CodeMaze - Code-First approach and Entity Framework Core Series
- Learn Entity Framework Core 📓
- AutoMapper with EF
- Getting Started with AutoMapper in ASP.NET Core 📓CodeMaze
- Performance comparison of different mappers 📽️12m - Nick Chapsas - Mapperly, Automapper, AgileMapper, TinyMapper, Mapster, MappingGenerator
- Response compression 📓Milan's newsletter
- Running async tasks on app Startup 📓AndrewLock - Using HostedService
- How to log the generated SQL queries by the EF
- Default 404 response. Tips and tricks for ASP.NET Core applications 📓DustedCodes
- Generating realistic data with Bogus 📓CodeMaze
- Publish MediatR Notifications in parallel 📓Milan's newsletter
- Clean architecture - JasonTaylor
- Unleashing Clean Architecture in .NET 8 📽️45m
- CleanArchitecture 👤jasontaylordev