Just urging folks to not just try to shoehorn Wolverine in as a drop in replacement for MediatR:

Wolverine Idioms for MediatR Users https://jeremydmiller.com/2026/01/26/wolverine-idioms-for-mediatr-users/

Wolverine Idioms for MediatR Users

The Wolverine community fields a lot of questions from people who are moving to Wolverine from their previous MediatR usage. A quite natural response is to try to use Wolverine as a pure drop in re…

The Shade Tree Developer

@jeremydmiller From this post, how is Cart resolved in AddToCartRequestEndpoint? Is it coming from the IoC and expected to resolve?

I would guess there's something else that pulls user information to get "their cart” that isn't shown here.

Update: reading the docs is helpful :) https://wolverinefx.net/guide/handlers/persistence.html#automatically-loading-entities-to-method-parameters

Persistence Helpers | Wolverine

Next Generation Command and Message Bus for .NET

@jeremydmiller Is there a way to resolve the Id from something like a session Id or a claim on the principal?

In this case, carts are sometimes tied to the individual, and they can have only a single active cart at a time. So, passing the ID to the endpoint is not necessary in this case.

@khalidabuhakmeh No magic built in for claims, but you could pretty easily use middleware to do that. Point being that you'd want the "Cart" being fed into the happy path handler method and keep that handler a synchronous pure function for easy testing
@jeremydmiller I'll have to put that on my todo list of things to explore.
Railway Programming with Wolverine (Kind Of) | Wolverine

Next Generation Command and Message Bus for .NET

@khalidabuhakmeh @jeremydmiller as far as I've understood Wolverine and Marten, the request probably must have a cartId which is then used to load the appropriate Cart event stream to which the addProductRequest gets appended to.
If I recall correctly, Wolverine generates corresponding "boilerplate" code around during compile time and nowadays leverages IoC to fetch services. The "Cart" is however an Aggregate most probably, thus it will use Marten to fetch the corresponding stream..
@bibolorean @jeremydmiller Yep, that's correct. Found that after reading the documentation. :). I should have read the docs, but luckily, no one had to tap the sign. 😅
@bibolorean @khalidabuhakmeh If you were using Marten, sure. You'd have our flavor of the "Decider Pattern". The [Entity] thing in that blog post works for EF Core too though. Just no event sourcing for EF Core (yet)

@khalidabuhakmeh And Wolverine is trying really hard in most cases to *not* use IoC at runtime. That's a significant difference from other tools.

Admittedly trips up some users of course