Chapter 7: CQRS in Action

Having learned what the CQRS pattern, the Mediator pattern, and the MediatR NuGet package are, it's time to apply them in the ASP.NET Core 5 Web API that we are building. The patterns and package mentioned will bring value to our application by making it very scalable, testable, and readable.

In this chapter, we will cover the following topics while writing code in our application:

  • Implementing CQRS
  • Adding the MediatR package
  • Creating MediatR pipeline behaviors
  • Using FluentValidation
  • Using AutoMapper
  • Writing queries
  • Writing commands
  • Writing IServiceCollection

Technical requirements

Here is what you need to complete this chapter:

  • Visual Studio 2019, Visual Studio for Mac, or Rider
  • The .NET CLI

You can go to the following ...

Get ASP.NET Core and Vue.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.