Skip to content

Sample Application

Kieron Lanning edited this page Apr 16, 2026 · 1 revision

Sample Application

Projects

Project Purpose
EventSourcing.Samples Domain types and application services
EventSourcing.Samples.Web Razor Pages UI
EventSourcing.Samples.AppHost Aspire local orchestration
EventSourcing.Samples.ServiceDefaults Health checks, telemetry, and service discovery helpers

What the sample demonstrates

  • non-generic IEventStore / IQueryableEventStore usage
  • transaction-based multi-aggregate workflows
  • SQL Server events + SQL Server queryable snapshots
  • Redis distributed caching when available
  • Azure Blob-backed product image service when configured
  • Aspire-driven local orchestration for SQL Server, Redis, and Azurite

Key services

CartCheckoutService

  • loads the customer
  • loads and validates multiple inventory records
  • creates an order
  • enlists the order plus inventory reservations in one transaction

OrderFulfillmentService

  • creates and confirms an order
  • reserves stock
  • commits both aggregates through a transaction

StockTransferService

  • loads source and destination locations
  • adjusts source and destination inventory
  • commits both aggregate changes through a transaction

Running the sample

Standalone web app

Run the sample web project with the required connection strings configured.

Aspire AppHost

EventSourcing.Samples.AppHost provisions:

  • SQL Server container + database
  • Redis
  • Azurite / blob storage emulator
  • the sample web project

This is the easiest way to spin up the full sample stack locally.

Clone this wiki locally