public void RecordState() { foreach (var device in _deviceProvider.GetAll() .Where(x => !x.Disabled) .Select(x => x.DeviceId)) { _stateProvider.RecordDeviceState(device); } }