private bool TryToHandleSensorsReading(SensorsReading sensorsReading) { if (!String.IsNullOrWhiteSpace(sensorsReading.Accelerometer.AccelerometerUnit)) { var result = _accelerometerHandler.Handle(sensorsReading.Accelerometer); if (result == null) { return(false); } } if (!String.IsNullOrWhiteSpace(sensorsReading.Gyroscope.GyroscopeUnit)) { var result = _gyroscopeHandler.Handle(sensorsReading.Gyroscope); if (result == null) { return(false); } } if (!String.IsNullOrWhiteSpace(sensorsReading.Location.LocationUnit)) { var result = _locationHandler.Handle(sensorsReading.Location); if (result == null) { return(false); } } sensorsReading.UserId = Int32.Parse(_httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier)?.Value); return(true); }