|
|
@@ -1,5 +1,6 @@ |
|
|
|
using System; |
|
|
|
using DotNetCore.CAP.Abstractions; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
|
|
|
namespace DotNetCore.CAP.Internal |
|
|
@@ -22,12 +23,15 @@ namespace DotNetCore.CAP.Internal |
|
|
|
|
|
|
|
public IConsumerInvoker CreateInvoker(ConsumerContext consumerContext) |
|
|
|
{ |
|
|
|
var context = new ConsumerInvokerContext(consumerContext) |
|
|
|
using(var scope = _serviceProvider.CreateScope()) |
|
|
|
{ |
|
|
|
Result = new DefaultConsumerInvoker(_logger, _serviceProvider, _modelBinderFactory, consumerContext) |
|
|
|
}; |
|
|
|
var context = new ConsumerInvokerContext(consumerContext) |
|
|
|
{ |
|
|
|
Result = new DefaultConsumerInvoker(_logger, scope.ServiceProvider, _modelBinderFactory, consumerContext) |
|
|
|
}; |
|
|
|
|
|
|
|
return context.Result; |
|
|
|
return context.Result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |