Pārlūkot izejas kodu

fixed consumer method add to DI exception. (#38)

master
Savorboard pirms 7 gadiem
vecāks
revīzija
9473d245a0
1 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. +5
    -3
      src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs

+ 5
- 3
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs Parādīt failu

@@ -67,13 +67,15 @@ namespace Microsoft.Extensions.DependencyInjection

private static void AddSubscribeServices(IServiceCollection services)
{
var consumerListenerServices = new Dictionary<Type, Type>();
var consumerListenerServices = new List<KeyValuePair<Type, Type>>();
foreach (var rejectedServices in services)
{
if (rejectedServices.ImplementationType != null
&& typeof(ICapSubscribe).IsAssignableFrom(rejectedServices.ImplementationType))

consumerListenerServices.Add(typeof(ICapSubscribe), rejectedServices.ImplementationType);
{
consumerListenerServices.Add(new KeyValuePair<Type, Type>(typeof(ICapSubscribe),
rejectedServices.ImplementationType));
}
}

foreach (var service in consumerListenerServices)


Notiek ielāde…
Atcelt
Saglabāt