// Handling a new vehicle connection sent from device public async Task HandleAsync(ConnectionSentByVehicleEvent connectionSentByVehicleEvent) { _logger.LogInformation("Handling a vehicle connection event handler"); var pingStatus = await _pingService.SendPingRequestAsync(connectionSentByVehicleEvent.VehicleIP); await _pingService.PersistPingInDbAsync(Guid.NewGuid().ToString(), connectionSentByVehicleEvent.VehicleId, connectionSentByVehicleEvent.VehicleIP, pingStatus, DateTime.Now); }
public async Task <SendPingRequestCommandResult> Handle(SendPingRequestCommand request, CancellationToken cancellationToken) { var pingStatus = await _pingService.SendPingRequestAsync(request.VehicleIP); return(new SendPingRequestCommandResult() { PingStatus = pingStatus, PingResponseDate = DateTime.Now }); }