예제 #1
0
 /// <summary>
 /// Creates a webmodule listening to the get requests for all the sensors.
 /// </summary>
 /// <param name="serializer"></param>
 /// <param name="sensorFactory"></param>
 public WebModule(Serializer.ISerializer serializer, ISensorFactory sensorFactory)
 {
     _serializer = serializer;
     foreach (var sensor in sensorFactory.GetSensors())
     {
         string getPath = $"/{sensor.Name}";
         Console.WriteLine($"Listening for get on {getPath}");
         Get[getPath] = paramaters => QuerySensor(sensor);
     }
 }
예제 #2
0
 /// <summary>
 /// Creates a webmodule listening to the get requests for all the sensors.
 /// </summary>
 /// <param name="serializer"></param>
 /// <param name="sensorFactory"></param>
 public WebModule(Serializer.ISerializer serializer, ISensorFactory sensorFactory)
 {
     _serializer = serializer;
     foreach (var sensor in sensorFactory.GetSensors())
     {
         string getPath = $"/{sensor.Name}";
         Console.WriteLine($"Listening for get on {getPath}");
         Get[getPath] = paramaters => QuerySensor(sensor);
     }
 }