jbogard / MediatR.Extensions.Microsoft.DependencyInjection

MediatR extensions for Microsoft.Extensions.DependencyInjection
MIT License
326 stars 90 forks source link

MediatRServiceConfiguration not working #108

Open trannamtrung1st opened 2 years ago

trannamtrung1st commented 2 years ago

With this code, I still always get my handlers as transient services, not Scoped services as expected.

services.AddMediatR(config => config.AsScoped(), ProjectTypes.All)

After inspecting the source code, I don't see we use the configuration in: https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection/blob/c11d372a301fd99d06cf3d1d3a351bec14f76144/src/MediatR.Extensions.Microsoft.DependencyInjection/Registration/ServiceRegistrar.cs#L13

Did I miss something? Thanks in advance.