public SensorDto GetSensor(int sensorId)
 {
     using (var context = new ClientSensorLocationEntities())
     {
         return context.Sensors.Find(sensorId).Convert();
     }
 }
 public RoomDto GetRoom(int roomId)
 {
     using (var context = new ClientSensorLocationEntities())
     {
         return context.Rooms.Find(roomId).Convert();
     }
 }
 public IEnumerable<SensorDto> GetAllRegisteredSensors()
 {
     using (var context  = new ClientSensorLocationEntities())
     {
         foreach (var sensor in context.Sensors)
         {
             yield return sensor.Convert();
         }
     }
 }
        public IEnumerable<RoomDto> GetRooms()
        {
            var result = new List<RoomDto>();
            using (var context = new ClientSensorLocationEntities())
            {
                foreach (var room in context.Rooms)
                {
                    result.Add(room.Convert());
                }
            }

            return result;
        }