Added full Optimistic Concurrency handling in all samples with integration to ETag
Added optimistic concurrency to samples and did a huge all-around refactoring.
The most significant changes:
- Added OptimisticConcurrencyMiddleware and related classes to support full flow based on the ETag. Applied both for Marten and EventStoreDB samples,
- Aligned convention around Records (use them for DTOs with static factory method for validation),
- Introduced StreamEvent for EventStoreDB subscriptions to gather information about stream revision and global position. That can be used for idempotency checks in projections.
- Made MartenExternalProjection, EntityFrameworkProjection idempotent,
- Merged EventStoreDB improvements from Simple EventStoreDB examples into Core project,
- Added NoMediatorEventBus to not rely on the marker interfaces need etc.
- Aligned ECommerce samples:
- API structure and models
- The same set of integration tests,
- Naming and structure conventions
- Added CorrelationIdMiddleware and plugged it initially. More changes will come in the follow-up PR,
- Unified background processing for ESDB Subscriptions and Kafka Consumers
See more in: #100.