Browse Source

update GetService to GetRequiredService

master
yangxiaodong 7 years ago
parent
commit
3a205b0b84
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs

+ 4
- 4
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs View File

@@ -110,15 +110,15 @@ namespace DotNetCore.CAP.Processor
var returnedProcessors = new List<IProcessor>(); var returnedProcessors = new List<IProcessor>();
for (int i = 0; i < processorCount; i++) for (int i = 0; i < processorCount; i++)
{ {
var messageProcessors = _provider.GetService<IDispatcher>();
var messageProcessors = _provider.GetRequiredService<IDispatcher>();
_messageDispatchers.Add(messageProcessors); _messageDispatchers.Add(messageProcessors);
} }
returnedProcessors.AddRange(_messageDispatchers); returnedProcessors.AddRange(_messageDispatchers);


returnedProcessors.Add(_provider.GetService<PublishQueuer>());
returnedProcessors.Add(_provider.GetService<SubscribeQueuer>());
returnedProcessors.Add(_provider.GetRequiredService<PublishQueuer>());
returnedProcessors.Add(_provider.GetRequiredService<SubscribeQueuer>());


returnedProcessors.Add(_provider.GetService<IAdditionalProcessor>());
returnedProcessors.Add(_provider.GetRequiredService<IAdditionalProcessor>());


return returnedProcessors.ToArray(); return returnedProcessors.ToArray();
} }


Loading…
Cancel
Save