Skip to content

Remove implicit save changes in mocha ef core middleware#9501

Merged
PascalSenn merged 2 commits intomainfrom
pse/fix-mediator-transaction-middleware
Apr 2, 2026
Merged

Remove implicit save changes in mocha ef core middleware#9501
PascalSenn merged 2 commits intomainfrom
pse/fix-mediator-transaction-middleware

Conversation

@PascalSenn
Copy link
Copy Markdown
Member

@PascalSenn PascalSenn commented Apr 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 12:26
@github-actions github-actions bot added the 📚 documentation This issue is about working on our documentation. label Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the implicit DbContext.SaveChangesAsync call from Mocha’s EF Core transaction middleware and updates the documentation to reflect that command handlers must persist changes explicitly.

Changes:

  • Removed automatic SaveChangesAsync invocation from EntityFrameworkTransactionMiddleware before committing.
  • Updated the middleware XML docs to clarify that handlers must call SaveChangesAsync.
  • Updated the mediator pipeline documentation and EF transaction section to describe the new responsibility split (handlers save; middleware manages transaction lifecycle).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
website/src/docs/mocha/v1/mediator/pipeline-and-middleware.md Updates the transaction middleware examples/description to remove implicit saving and clarify handler responsibilities.
src/Mocha/src/Mocha.EntityFrameworkCore/EntityFrameworkTransactionMiddleware.cs Removes implicit SaveChangesAsync calls and updates XML docs accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PascalSenn PascalSenn merged commit e2478ff into main Apr 2, 2026
3 checks passed
@PascalSenn PascalSenn deleted the pse/fix-mediator-transaction-middleware branch April 2, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants