/// <summary> /// Get Device type by provided id /// </summary> /// <param name="id"></param> /// <returns></returns> public DeviceTypeDomain GetDeviceTypeById(int id) { if (id <= 0) { throw new NsiArgumentException(DeviceTypeMessages.DeviceTypeInvalidArgument); } return(_deviceTypeRepository.GetDeviceTypeById(id)); }
public async Task <IActionResult> GetOneDeviceType(int id) { try { var result = await _repository.GetDeviceTypeById(id); var devices = _mapper.Map <DeviceTypeDTO>(result); return(Ok(devices)); } catch (Exception ex) { return(BadRequest(ex)); } }