From b6d15dd86638e388b3c6fc5d6d03bddbcf3f3e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Z=C3=A1le=C5=A1=C3=A1k?= Date: Sun, 26 Oct 2025 15:30:54 +0100 Subject: [PATCH] docs: Storage Operations with EF Core - add section about transactional middleware auto-application --- docs/guide/durability/efcore/operations.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guide/durability/efcore/operations.md b/docs/guide/durability/efcore/operations.md index c016a1f90..5f02801d7 100644 --- a/docs/guide/durability/efcore/operations.md +++ b/docs/guide/durability/efcore/operations.md @@ -137,6 +137,16 @@ public static class TodoHandler snippet source | anchor +::: warning +When a handler returns an `IStorageAction`, Wolverine automatically +applies [transactional middleware](/guide/durability/marten/transactional-middleware) for that handler — even if the +handler is not explicitly decorated with `[Transactional]` or `AutoApplyTransactions()` is not configured. + +This behavior is required because Wolverine needs to automatically call `SaveChangesAsync()` on the EF Core `DbContext` +to persist the storage operation, which should be done within a single transaction together with publication of messages +to the outbox/inbox. +::: + ## [Entity] Wolverine also supports the usage of the `[Entity]` attribute to load entity data by its identity with EF Core. As you'd