예제 #1
0
        public async Task <IActionResult> GetDevice([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var device = _mapper.Map <DeviceDetailsDto>(await _service.GetDevice(id));

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

            return(Ok(device));
        }