[UseResolverScopedMediator] public async Task GetAccountsAsync( IResolverContext context, [ScopedState] IMediator mediator) => await mediator.Send(new SomeRequest()); // Note: Here mediator is scoped, and when the handler is instantiated, all its dependencies are generated in the same scope, // including DbContext instances, so no multi-thread usage :)