public async Task StopAsync(CancellationToken cancellationToken) { _logger.LogInformation("RFID Service is stopping."); await _rfidReader.StopAsync(); _logger.LogInformation("RFID Service has stopped."); }
public async Task StopAsync(CancellationToken cancellationToken) { whenButtonPressedSubscription.Dispose(); whenButtonReleasedSubscription.Dispose(); whenSwitchClosedSubscription.Dispose(); whenSwitchOpenedSubscription.Dispose(); whenMotionDetectedSubscription.Dispose(); whenMotionNotDetectedSubscription.Dispose(); await _rfidReader.StopAsync(); whenCardDataReceivedSubscription.Dispose(); }