private void BarsStorage_IncompleteBarOutdated(object sender, ExtendedBarSensorData e)
        {
            switch (e.ValueType)
            {
            case SensorType.IntegerBarSensor:
            {
                var typedValue = e.Value as IntBarSensorValue;
                typedValue.EndTime = DateTime.Now.ToUniversalTime();
                SensorDataEntity obj = _converter.ConvertToDatabase(typedValue, e.TimeCollected);
                SaveSensorValue(obj, e.ProductName);
                break;
            }

            case SensorType.DoubleBarSensor:
            {
                var typedValue = e.Value as DoubleBarSensorValue;
                typedValue.EndTime = DateTime.Now.ToUniversalTime();
                SensorDataEntity obj = _converter.ConvertToDatabase(typedValue, e.TimeCollected);
                SaveSensorValue(obj, e.ProductName);
                break;
            }
            }
        }
 public static SensorHistoryData Convert(this ExtendedBarSensorData data) =>
 data.ValueType switch
 {