Ver a proveniência

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

master
Savorboard há 7 anos
ascendente
cometimento
9473d245a0
1 ficheiros alterados com 5 adições e 3 eliminações
  1. +5
    -3
      src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs

+ 5
- 3
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs Ver ficheiro

@@ -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)


Carregando…
Cancelar
Guardar