Comments (2)
If for certain use cases you expect concurrent calls whose simultaneous write breaks business rules, you can use one more method besides the methods you mentioned - repeat command processing.
Then validation on the command handler / domain model will detect broken rule (because side effect of another command is already persisted) and the application will return an appropriate message.
The important thing is to have always all validation on the application side and treat database as "last line of defense" against such situations.
You can use the Polly library to implement this behavior
from sample-dotnet-core-cqrs-api.
The important thing is to have always all validation on the application side and treat database as "last line of defense" against such situations.
I think this is a good idea. It helped me a lot.
from sample-dotnet-core-cqrs-api.
Related Issues (20)
- Query Handlers and responsabilities HOT 3
- Communication between contexts - Implement RemoveCustomer method that checks if customer has any orders. HOT 2
- "Light" OrderDto HOT 1
- If there have multiple instances of ProcessOutBoxJob, The events may be processed in many times. HOT 3
- Should we persist this to the database? HOT 2
- Migrations HOT 1
- Problem with context.SaveChangesAsync() after removing objects from List<>
- StronglyTypedIdValueConverterSelector should be Singleton HOT 1
- Product existence check / Asynchronous domain HOT 1
- Outbox pattern maybe lock in OutboxMessages table
- Is it mandatory to use Guid for Id in entity or aggregate? HOT 1
- 1
- Decorator registration is not working with Autofac 6.x HOT 1
- Raw SQL in application layer
- DDD EF Core Remove issue HOT 8
- IDomainEventDispatcher and its implementation class
- Customer as Aggregate
- Ordering of DomainEventNotifications in OutboxMessages table
- Add a license HOT 1
- why not just inject IDbConnection instead of ISqlConnectionFactory? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-dotnet-core-cqrs-api.