Browse Source

modify cap subscribe method register to DI with transient.

master
yangxiaodong 7 years ago
parent
commit
0e52aa1fb2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs

+ 2
- 2
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs View File

@@ -78,7 +78,7 @@ namespace Microsoft.Extensions.DependencyInjection

foreach (var service in consumerListenerServices)
{
services.AddSingleton(service.Key, service.Value);
services.AddTransient(service.Key, service.Value);
}

var types = Assembly.GetEntryAssembly().ExportedTypes;
@@ -86,7 +86,7 @@ namespace Microsoft.Extensions.DependencyInjection
{
if (Helper.IsController(type.GetTypeInfo()))
{
services.AddSingleton(typeof(object), type);
services.AddTransient(typeof(object), type);
}
}
}


Loading…
Cancel
Save