EventSourcing.NetCore

Examples and Tutorials of Event Sourcing in .NET

MIT License

Stars
3.2K
Committers
31

Bot releases are visible (Hide)

EventSourcing.NetCore - Added EventStoreDB E-Commerce initial samples

Published by oskardudycz over 3 years ago

E-Commerce sample of Event Sourcing with EvenStoreDB

Sample is showing the typical flow of the Event Sourcing app with EventStoreDB.

Prerequisities

  1. Install git - https://git-scm.com/downloads.
  2. Install .NET Core 5.0 - https://dotnet.microsoft.com/download/dotnet/5.0.
  3. Install Visual Studio 2019, Rider or VSCode.
  4. Install docker - https://docs.docker.com/docker-for-windows/install/.
  5. Open ECommerce.sln solution.

Running

  1. Go to docker and run: docker-compose up.
  2. Wait until all dockers got are downloaded and running.
  3. You should automatically get:
  4. Open, build and run ECommerce.sln solution.

Overview

It uses:

  • CQRS with MediatR,
  • Stores events from Aggregate method results to EventStoreDB,
  • Builds read models using Subscription to $all.
  • Read models are stored as Marten documents.
  • App has Swagger and predefined docker-compose to run and play with samples.

Write Model

  • Most of the write model infrastructure was reused from other samples,
  • Added new project Core.EventStoreDB for specific EventStoreDB code,
  • Added EventStoreDBRepository repository to load and store aggregate state,
  • Added separate IProjection interface to handle the same way stream aggregation and materialised projections,
  • Thanks to that added dedicated AggregateStream method for stream aggregation
  • See sample Aggregate

Read Model

Tests

Other

Trivia

  1. Docker useful commands
    • docker-compose up - start dockers
    • docker-compose kill - to stop running dockers.
    • docker-compose down -v - to clean stopped dockers.
    • docker ps - for showing running dockers
    • docker ps -a - to show all dockers (also stopped)
EventSourcing.NetCore - Updated to Marten v4 alpha

Published by oskardudycz over 3 years ago

EventSourcing.NetCore - Updated to .NET 5

Published by oskardudycz almost 4 years ago

See more in: https://github.com/oskardudycz/EventSourcing.NetCore/pull/32

EventSourcing.NetCore - Unified Core architecture components

Published by oskardudycz about 4 years ago

Unified multiple Core architecture components into projects that are reused acrosss all samples.

EventSourcing.NetCore - Upgraded to NetCore 2.1

Published by oskardudycz about 6 years ago

EventSourcing.NetCore - Upgraded versions of MediatR to 4

Published by oskardudycz almost 7 years ago

Upgraded to newest versions of packages. Breaking changes after upgrade to MediatR 4. Now only Asynchronous handlers are available. Synchronous were removed, and asynchronous were renamed to "regular" eg. IAsyncCommandHandler to AsyncCommandHandler

EventSourcing.NetCore - Added Sample of CQRS with Entity Framework

Published by oskardudycz almost 7 years ago

EventSourcing.NetCore - Upgraded versions of Marten to 2 and MediatR to 3

Published by oskardudycz about 7 years ago

EventSourcing.NetCore - MediatR Description

Published by oskardudycz over 7 years ago

EventSourcing.NetCore - Marten Description

Published by oskardudycz over 7 years ago