This repository contains multiple implementations of the same API
. You can find more details about the API
in the The API part below.
All of this is based on various real-world CQRS
applications and point of views (and Greg Young's work).
Each branches of this repository shows a different and gradual approach to CQRS
:
The Master branch contains the most advanced version of the application and serves as a showcase for CQRS
projects.
Currently on Master:
- The example API with all routes, without Command/Query separation yet, come back later
- Next step: separating source files in multiple projects for the sake of readability and SOLID.
The Basic-Core branch contains the API working without any traces of the CQRS or DDD patterns.
This is a first version only used for future references and comparison. Here, all source files are parts of the same project with only a simple folder separation.
Coming Next:
The Domain-Core branch will contains a simple domain and infrastructure separation as presented in the eShopOnContainers examples.
The CQRS-Core branch will contains a simple separation of Commands
and Queries
.
The CQRS-Event branch will contains a Command/Query with event management.
The CQRS-Event-Sourcing will contains a Command/Query with Event Sourcing and a separation between EventStore and ViewStore Databases.
The above branches all exposes the same API
, you can find it here or directly on the API
after launching it at http://localhost:yourport/swagger. This is a simplified view of the exposed methods:
- /articles (Add, Update, View, Delete, View Last 5, View all from Author)
- /authors (View)
- /comments (Add, View all from Article)
- Article (Id, Title, Content, CreationDate, AuthorId)
- Comment (Id, Content, CreationDate, AuthorName, ArticleId)
- Author (Id, Name, RegisterDate)
This is work in progress for now, check back later!
Tools used during the development:
- Swagger.io and it's Editor for the Documentation.
- Swashbuckles for the .Net Core implementation of Swagger.
- Dapper for the SQL mapping.
Source for some Pattern Ideas:
- Microsoft eShopOnContainers which contains multiple examples of crud-based and DDD-based WebAPI in .Net Core.