Repository navigation
Remove MediatR and simplify ordering workflows - #1091
Draft
DamianEdwards wants to merge 4 commits into
Draft
DamianEdwards wants to merge 4 commits into
DamianEdwards wants to merge 4 commits into
Conversation
Consolidate command and domain-event handling into explicit order application service operations. Retain validation, request deduplication, transaction retries, and integration-event outbox behavior, with focused relational and PostgreSQL regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
eerhardt
reviewed
Nov 16, 2026
|
|
||
| ## Ordering workflows | ||
|
|
||
| The Ordering API calls a concrete `OrderApplicationService` directly from its HTTP endpoints and integration-event handlers. The service validates commands, deduplicates client requests, and coordinates buyer, payment, and order updates within a database transaction. Domain aggregates enforce their business rules without internal event dispatch. Integration events are saved to the outbox in the same transaction and published only after commit. |
Member
There was a problem hiding this comment.
Is this needed in the main README?
Limit identified-operation failure results to validation and domain exceptions so database and transaction failures reach HTTP 500. Cover transaction start, request registration, commit rollback, and the HTTP error contract. Make Ordering's outbox event assembly explicit for correct deserialization under hosted execution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Remove MediatR entirely by simplifying Ordering's application flow, rather than introducing another mediator or dispatch abstraction. Order processing is now explicit and easier to follow from HTTP endpoints and integration-event handlers.
Approach
OrderApplicationServicewith explicit operations.Validation
dotnet build eShop.Web.slnf --nologo -v:qpassed, with existing dependency advisory warnings.Review follow-up
Addressed the Opus finding about infrastructure failures being converted into successful checkout responses. Only validation and domain exceptions retain the existing boolean failure result for identified operations. Database, transaction, and other infrastructure exceptions propagate to HTTP 500 rather than acknowledging an order that was not saved.