Skip to content

In this repository , i will explain how to use CQRS and MediatR design pattern and why application will need this patterns via WebApi and WebSite.

Notifications You must be signed in to change notification settings

Hasanaltan-cpu/CQRS-Definition-Project

Repository files navigation

Requirements

  • MediatR 9.0.0
  • MediatR.DependencyInjection 9.0.0
  • EntityFrameworkCore
  • Asp.NetCore.SQL
  • Asp.NetCore.Tools
  • Asp.NetCore.Identity

Command Query Responsibility Segregation

CQRS is the idea that we should compose our systems of command and query operations and keep these separated whenever possible.

CQRS

Command

Commands, or writes, alter the data within a system. In this context, a ‘write’ has little to do with the traditional idea of writing to disk. Think of it more as a logical rather than a physical write. It’s a system state change—whether to memory, disk or remote service. All commands to be made in the application contain tariff classes.


  • Update , Insert , Delete

Query

Queries, or reads, are requests for data from a system. Again, we are referring to logical reads rather than physical reads. The data can be read from disk, memory.It contains classes that will describe all the queries that will be made in the application.


  • Select , List

Handlers

-It contains classes that will process all Command or Query requests to be made in the application and return response objects as a result.

MediatR Design Pattern

  • In software engineering, the mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program’s running behavior. In object-oriented programming, programs often consist of many classes.

In simply we can see Mediator pattern is another design pattern that dramatically reduces the coupling between various components of an application by making them communicate indirectly, usually via a special mediator object. We will dive deep into Mediator in another post. Essentially, the Mediator pattern is well suited for CQRS implementation.

About

In this repository , i will explain how to use CQRS and MediatR design pattern and why application will need this patterns via WebApi and WebSite.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published