Masstransit AddMediator() method not exists

747 Views Asked by At

I'm new to use MassTransit. to use the mediator.

services.AddMassTransit(options => 
{
    options.AddConsumer<SubmitOrderConsumer>();
    options.AddMediator(); // this function is not found
    options.AddRequestClient<ISubmitOrder>();
});

Which package has the AddMediator() extension method? I'm trying with Masstransit v7.x and cannot find AddMediator() method.

1

There are 1 best solutions below

1
On BEST ANSWER

Thank you @Peter Csala,

it's updated now in Masstransit v7.x.

Container configuration has changed, and now uses the AddMediator method (instead of AddMassTransit. According to. MassTransit Upgrade

services.AddMediator(options =>
    {
        options.AddConsumer<SubmitOrderConsumer>();
        options.AddRequestClient<ISubmitOrder>();
    });