Skip to content

Commit 8c0d41e

Browse files
committed
Fix issue Autofac IAsyncRequestHandler not registered with Mediatr 3.0
1 parent b42fe35 commit 8c0d41e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ protected override void Load(ContainerBuilder builder)
4444
builder.Register<SingleInstanceFactory>(context =>
4545
{
4646
var componentContext = context.Resolve<IComponentContext>();
47-
48-
return t => componentContext.Resolve(t);
49-
});
47+
return t => { object o; return componentContext.TryResolve(t, out o) ? o : null; };
48+
});
5049

5150
builder.Register<MultiInstanceFactory>(context =>
5251
{

0 commit comments

Comments
 (0)