1.5 KiB
1.5 KiB
E-Commerce Example: Complete Code
See the complete working implementation in the Svrnty.Sample project.
Project Structure
OrderManagement.Api/
├── Program.cs
├── Controllers/
└── Protos/
OrderManagement.CQRS/
├── Commands/
│ ├── PlaceOrderCommand.cs
│ ├── CancelOrderCommand.cs
│ └── Validators/
├── Queries/
│ ├── GetOrderQuery.cs
│ └── ListOrdersQuery.cs
├── Events/
│ └── OrderPlacedEvent.cs
├── Workflows/
│ └── OrderFulfillmentSaga.cs
└── Projections/
└── OrderSummaryProjection.cs
OrderManagement.Domain/
├── Entities/
│ ├── Order.cs
│ └── Customer.cs
└── Events/
OrderManagement.Infrastructure/
├── Repositories/
│ ├── OrderRepository.cs
│ └── CustomerRepository.cs
└── Services/
├── PaymentService.cs
└── ShippingService.cs
See Sample Project
The Svrnty.Sample project contains a complete implementation:
- Svrnty.Sample/Commands
- Svrnty.Sample/Queries
- Svrnty.Sample/Events
- Svrnty.Sample/Workflows
- Svrnty.Sample/Projections
Run the Sample
cd Svrnty.Sample
dotnet run