Skip to content

Commit 3c6b4ad

Browse files
committed
2 parents 6c855e5 + d8b6d5e commit 3c6b4ad

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)