public string Add(DeviceModel deviceModel) { var newDevice = mapper.map(deviceModel); deviceRepository.Add(newDevice); return("Device created"); }
public IActionResult GetDeviceDetails(long id) { try { return(Ok(DeviceMapper.map(itemRepository.GetDeviceById(id)))); } catch (Exception) { return(BadRequest()); } }
public List <DeviceModel> GetUserDevices(int id) { var dev = userRepository.GetDevices(id); List <DeviceModel> devModels = new List <DeviceModel>(); foreach (Device d in dev) { devModels.Add(devMapper.map(d)); } return(devModels); }