Summary
You have learned that CQRS separates commands, which are requests that mutate or write data, and queries, which are requests to read data. You also learned how CQRS helps you to write slimmer controllers.
You have also learned that the Mediator design pattern acts like an air traffic controller between commands/queries and the handlers. You learned the implementation of a mediator pattern that you can use in .NET, the MediatR NuGet package, a time saver because you don't need to implement it yourself, and using Mediator makes your code cleaner and more maintainable.
You also have seen drawbacks of using CQRS, including writing extra code, but the additional code means implementing CQRS to make cleaner and more maintainable code.
In the next chapter, we will apply the CQRS pattern and the mediator pattern and use the MediatR NuGet package in ASP.NET Core 5 to build a highly scalable and maintainable Web API.