Commit 756935ab authored by Savorboard's avatar Savorboard

fixed .net core 2.0 services resolve bug

parent 975fcb7d
......@@ -49,7 +49,10 @@ namespace DotNetCore.CAP.Internal
{
var executorDescriptorList = new List<ConsumerExecutorDescriptor>();
var consumerServices = provider.GetServices<ICapSubscribe>();
using (var scoped = provider.CreateScope())
{
var scopedProvider = scoped.ServiceProvider;
var consumerServices = scopedProvider.GetServices<ICapSubscribe>();
foreach (var service in consumerServices)
{
var typeInfo = service.GetType().GetTypeInfo();
......@@ -62,6 +65,7 @@ namespace DotNetCore.CAP.Internal
}
return executorDescriptorList;
}
}
private static IEnumerable<ConsumerExecutorDescriptor> FindConsumersFromControllerTypes(
IServiceProvider provider)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment