Example #1
0
        public async Task <IActionResult> GetAsync(string mac)
        {
            var sensor = await _sensorService.GetByMACAsync(mac, CancellationToken.None);

            if (sensor == null)
            {
                return(NotFound());
            }

            var sensorViewModel = _mapper.Map <SensorViewModel>(sensor);

            return(Ok(sensorViewModel));
        }