Soft Delete Example
Overview
Complete Flow Architecture
PUT Request → Controller → Service → PreBus Plugins → Command Handler → Domain Model → Database → Event Publishing → SubscribersDetailed Flow Breakdown
1. PUT Request
↓
2. Controller (API Entry Point)
↓
3. Service Layer (Business Orchestration)
↓
4. PreBus Processing (Validation Pipeline)
├── SoftDeleteProductSequence (Plugin Registration)
├── SoftDeleteProductDataPacket (Validation Context)
└── IsValidForSoftDelete Plugin (Business Rules)
↓
5. Command Handler (Data Processing)
↓
6. Domain Model (Business Logic)
↓
7. Database (Data Persistence)
↓
8. Event Publishing (Asynchronous Processing)
↓
9. Subscribers (Side Effects)Step-by-Step Implementation
1. API Controller - The Entry Point
2. Service Layer - Business Orchestration
2.1. PreBus Business Rule Sequence - Validation Pipeline
2.2. PreBus Data Packet - Validation Context
2.3. PreBus Validation Plugin - Business Rules
3. Command Handler - Data Processing
4. Domain Model - Business Logic
5. NServiceBus Handler - Message Processing
6. Event Publishing - Asynchronous Processing
7. Event Subscribers - Side Effects
Data Transfer Objects (DTOs)
Input DTO: SoftDeleteProductDto
SoftDeleteProductDtoCommand: SoftDeleteProductCommand
SoftDeleteProductCommandKey Differences from Regular Delete/Update
Soft Delete-Specific Characteristics
PreBus Validation Focus
Soft Delete vs Hard Delete vs Update
Aspect
Soft Delete
Hard Delete
Update
Flow Summary
Synchronous Flow (Immediate Response)
Asynchronous Flow (Event Processing)
Key Benefits
Last updated