Procházet zdrojové kódy

fixed .net core 2.0 services resolve bug

master
Savorboard před 7 roky
rodič
revize
756935abfb
1 změnil soubory, kde provedl 14 přidání a 10 odebrání
  1. +14
    -10
      src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs

+ 14
- 10
src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs Zobrazit soubor

@@ -48,19 +48,23 @@ namespace DotNetCore.CAP.Internal
IServiceProvider provider)
{
var executorDescriptorList = new List<ConsumerExecutorDescriptor>();

var consumerServices = provider.GetServices<ICapSubscribe>();
foreach (var service in consumerServices)
using (var scoped = provider.CreateScope())
{
var typeInfo = service.GetType().GetTypeInfo();
if (!typeof(ICapSubscribe).GetTypeInfo().IsAssignableFrom(typeInfo))
var scopedProvider = scoped.ServiceProvider;
var consumerServices = scopedProvider.GetServices<ICapSubscribe>();
foreach (var service in consumerServices)
{
continue;
}
var typeInfo = service.GetType().GetTypeInfo();
if (!typeof(ICapSubscribe).GetTypeInfo().IsAssignableFrom(typeInfo))
{
continue;
}

executorDescriptorList.AddRange(GetTopicAttributesDescription(typeInfo));
executorDescriptorList.AddRange(GetTopicAttributesDescription(typeInfo));
}
return executorDescriptorList;
}
return executorDescriptorList;
}

private static IEnumerable<ConsumerExecutorDescriptor> FindConsumersFromControllerTypes(
@@ -76,7 +80,7 @@ namespace DotNetCore.CAP.Internal
{
executorDescriptorList.AddRange(GetTopicAttributesDescription(typeInfo));
}
}
}

return executorDescriptorList;
}


Načítá se…
Zrušit
Uložit