This project is followed the articles series Real-World CQRS/ES with ASP.NET and Redis which is post by @exceptionnotfound.
You can also found the origin project here.
@exceptionnotfound post the articles 2 years ago and it has a lot of changes with the tech.
Such like:
- asp.net -> asp.net core
- 3rd party DI container StructureMap -> MS DI.
- CQRSlite methods upgrade for asp.net core.
- AutoMapper version upgrade which has some break change.
and so on. So I try to fix the project's problems when I read the articles.
-
Read the articles first, then try to compare the projects.
-
In this project, we use redis to store the event data. If you had install Docker, you can start the container by
docker run --name local-redis -d -p 6379:6379 redis:4.0
-
Run the projects Commands, Queries with Multiple startup projects setting.
-
Then start new instance with Initializer project(also you can skip this step).
-
Use Postman to try to add data from http://localhost:53958/api/ and receive data from http://localhost:58167/api/ .
-
Use RavenDBEventStore to instead of InMemoryEventStore. You can start like this:
- Use docker to start the RavenDB container.
docker run -d -e PUBLIC_SERVER_URL=http://172.17.0.2:8080 -e PUBLIC_TCP_SERVER_URL=http://172.17.0.2:38888 -p 8080:8080 -p 38888:38888 ravendb/ravendb:ubuntu-latest
- Setup the RavenDB with https://localhost:8080 , then create the new document Northwind (You can change the document name and then change the appsettings.json Raven section in Commands project.)
TIPS: RavenDB 4.0 is not supported non-string identity property anymore. But CQRSLite IEvent use Guid Identity. So when I use IDocumentSession.Store(object, string) to store IEvent directly, it cause some errors.
-
Happy Coding!