public Task <Unit> Handle(SendOutageLocationIsolationCrewCommand request, CancellationToken cancellationToken) { return(Task.Run <Unit>(() => { _logger.LogInfo($"[OutageLifecycleCommandHandler::SendOutageLocationIsolationCrewCommand] Sending outage location isolation crew command for outage: {request.OutageId}"); using (OutageLifecycleUICommandingProxy commandingProxy = _proxyFactory.CreateProxy <OutageLifecycleUICommandingProxy, IOutageLifecycleUICommandingContract>( EndpointNames.OutageLifecycleUICommandingEndpoint) ) { try { commandingProxy.SendLocationIsolationCrew(request.OutageId); } catch (Exception ex) { _logger.LogError("[OutageLifecycleCommandHandler::SendOutageLocationIsolationCrewCommand] OutageLifecycleCommandHandler failed on SendOutageLocationIsolationCrew handler.", ex); throw; } } return Task.FromResult(new Unit()); }, cancellationToken)); }
public async Task <Unit> Handle(SendOutageLocationIsolationCrewCommand request, CancellationToken cancellationToken) { Logger.LogInformation($"[OutageLifecycleCommandHandler::SendOutageLocationIsolationCrewCommand] Sending outage location isolation crew command for outage: {request.OutageId}"); try { var sendLocationIsolationCrewClient = CrewSendingClient.CreateClient(); await sendLocationIsolationCrewClient.SendLocationIsolationCrew(request.OutageId); } catch (Exception ex) { Logger.LogError("[OutageLifecycleCommandHandler::SendOutageLocationIsolationCrewCommand] OutageLifecycleCommandHandler failed on SendOutageLocationIsolationCrew handler.", ex); throw; } return(new Unit()); }