Skip to content

Provides a structured way of handling data interactions, implementing the CQRS-pattern.

License

Notifications You must be signed in to change notification settings

prodot/Prodot.Patterns.Cqrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prodot.Patterns.Cqrs

Nuget Build

Introduction

Prodot.Patterns.Cqrs is a set of libraries that aim to ease the implementation of a CQRS data access and logic pattern. In it's implementation details, it is similar to a Mediator pattern or the request processing pipeline of ASP.Net Core.

Getting Started

  1. Install the packages
  2. Define your queries
    • Define your queries and commands using the IQuery<TResult, TSelf> and Command<TSelf> types.
  3. Implement your query handlers
    • Implement your query handlers using the IQueryHandler<TQuery, TResult> and (if required) IConfigurableQueryHandler<TConfiguration> interfaces.
      • If you want to enable CRUD-style queries using EF Core, you can use the base classes from Prodot.Patterns.Cqrs.EfCore (and the query base classes from Prodot.Patterns.Cqrs.EfCore.Abstractions)
  4. Register the pipelines
    • Register your pipelines using IPipelineProfile and PipelineBuilder.
  5. Use the query processor
    • Implement IQueryHandlerFactory specific to your DI container. Use that and QueryHandlerRegistry to create a QueryProcessor.
      • If you are using Microsoft.Extensions.DependencyInjection.ServiceCollection, there is a ready-to-use implementation in Prodot.patterns.Cqrs.MicrosoftExtensionsDependencyInjection
    • Use the IQueryProcessor to run your queries

Build and Test

The solution contained within this repository can be built and tested from within Visual Studio 2022 or later.

Contribute

If you want to contribute, feel free to reach out to Tim Vinkemeier :)

About

Provides a structured way of handling data interactions, implementing the CQRS-pattern.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages