How markwinap/be_dotnet_template_saga works
OrderService is a .NET order-management API. Authenticated clients create, list, retrieve, submit, and delete customer-scoped orders; submission persists the state change, publishes an event, and invokes saga orchestration. The graph reflects sampled API, handler, repository, and publisher code plus README-documented capabilities; saga internals and some infrastructure wiring were not sampled, so their internal relationships are omitted.
Main entry points: Program.cs Minimal API · OrderRepository.cs Order repository · SubmitOrderCommandHandler.cs Submit order · CreateOrderCommandHandler.cs Create order
Components 19
API access
- Minimal API
OrderService.Api/Program.cs - JWT auth
OrderService.Api/Program.cs
Order workflows
- Order handlers
OrderService.Application/Commands/CreateOrder/CreateOrderCommandHandler.cs - List orders
OrderService.Application/Queries/ListOrders/ListOrdersQueryHandler.cs - Get order
OrderService.Application/Queries/GetOrderById/GetOrderByIdQueryHandler.cs - Create order
OrderService.Application/Commands/CreateOrder/CreateOrderCommandHandler.cs - Submit order
OrderService.Application/Commands/SubmitOrder/SubmitOrderCommandHandler.cs - Delete order
OrderService.Application/Commands/DeleteOrder/DeleteOrderCommandHandler.cs - Cache behavior
OrderService.Application/Common/Behaviors/CachingBehavior.cs - Validation
OrderService.Application/Common/Behaviors/ValidationBehavior.cs
Order domain
- Order model
OrderService.Domain/Entities/Order.cs - Order events
OrderService.Domain/Events/OrderSubmittedEvent.cs
Infrastructure
- Order repository
OrderService.Infrastructure/Data/Repositories/OrderRepository.cs - Order database
OrderService.Infrastructure/Data/OrderDbContext.cs - Redis cache
OrderService.Infrastructure/Caching/RedisCacheService.cs - Service Bus publisher
OrderService.Infrastructure/Messaging/AzureServiceBusPublisher.cs - Saga orchestration
OrderService.Infrastructure/Saga/OrderProcessingSaga.cs
Other components
- API client
- Azure Service Bus
Connections 21
- API client → Minimal API: sends requests
- Minimal API → JWT auth: validates tokens
- Minimal API → List orders: dispatches query
- Minimal API → Get order: dispatches query
- Minimal API → Create order: dispatches command
- Minimal API → Submit order: dispatches command
- Minimal API → Delete order: dispatches command
- List orders → Order repository: reads orders
- Get order → Order repository: reads order
- Create order → Order model: creates order
- Create order → Order repository: saves order
- Create order → Redis cache: invalidates list
- Submit order → Order repository: loads and saves
- Submit order → Redis cache: invalidates entries
- Submit order → Service Bus publisher: publishes event
- Submit order → Saga orchestration: starts orchestration
- Delete order → Order repository: loads and removes
- Delete order → Redis cache: invalidates entries
- Order repository → Order database: queries and saves
- Service Bus publisher → Azure Service Bus: sends message
- Cache behavior → Redis cache: reads and writes