dotnet-cqrs/docs/tutorials/ecommerce-example/09-complete-code.md

64 lines
1.5 KiB
Markdown

# 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/Commands/)
- [Svrnty.Sample/Queries](../../../Svrnty.Sample/Queries/)
- [Svrnty.Sample/Events](../../../Svrnty.Sample/Events/)
- [Svrnty.Sample/Workflows](../../../Svrnty.Sample/Workflows/)
- [Svrnty.Sample/Projections](../../../Svrnty.Sample/Projections/)
## Run the Sample
```bash
cd Svrnty.Sample
dotnet run
```
## See Also
- [Getting Started](../../getting-started/README.md)
- [Best Practices](../../best-practices/README.md)