Skip to content

Commit b2218c5

Browse files
committed
Sensor methods were fixed
1 parent 672483d commit b2218c5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

WeatherControl/Wissance.WeatherControl.EdgeDb.Data/Entity/SensorEntity.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ public SensorEntity()
2828

2929
[EdgeDBProperty("Longitude")]
3030
public string Longitude { get; set; }
31+
32+
[EdgeDBProperty("Station")]
33+
public StationEntity Station { get; set; }
3134

32-
[EdgeDBProperty("MeasureUnit")]
35+
[EdgeDBProperty("Unit")]
3336
public MeasureUnitEntity MeasureUnit { get; set; }
3437

3538
[EdgeDBProperty("Measurements")]

WeatherControl/Wissance.WeatherControl.WebApi.V2/Factories/SensorFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public static SensorDto Create(SensorEntity entity)
1717
Name = entity.Name,
1818
Description = entity.Description,
1919
Latitude = entity.Latitude,
20-
Longitude = entity.Longitude
20+
Longitude = entity.Longitude,
21+
MeasureUnitId = entity.MeasureUnit.Id,
22+
StationId = entity.Station.Id
2123
};
2224

2325
if (entity.Measurements.Any())

WeatherControl/Wissance.WeatherControl.WebApi.V2/Helpers/EqlResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private string GetSortOption(SortOption sorting = null)
120120
{
121121
{ModelType.MeasureUnit, "SELECT MeasureUnit {{id, Name, Abbreviation, Description}} {0} {1} OFFSET {2} LIMIT {3}"},
122122
{ModelType.Measurement, "SELECT Measurement {{id, SampleDate, Value, Unit:{{id, Name, Abbreviation, Description}}, Station:{{id, Name, Longitude, Latitude}} }} {0} {1} OFFSET {2} LIMIT {3}"},
123-
{ModelType.Sensor , "SELECT Sensor {{id, Name, Latitude, Longitude, Measurements:{{id, SampleDate, Value}}, Unit:{{id, Name, Abbreviation}}, Station:{{id}} }} {0} {1} OFFSET {2} LIMIT {3}"},
123+
{ModelType.Sensor , "SELECT Sensor {{id, Name, Description, Latitude, Longitude, Measurements:{{id, SampleDate, Value}}, Unit:{{id, Name, Abbreviation}}, Station:{{id}} }} {0} {1} OFFSET {2} LIMIT {3}"},
124124
{ModelType.Station, "SELECT Station {{id, Name, Description, Latitude, Longitude, Sensors:{{ id, Name, Latitude, Longitude, Measurements:{{id, SampleDate, Value}} }} }} {0} {1} OFFSET {2} LIMIT {3}" }
125125
};
126126

0 commit comments

Comments
 (0)