public void Update(DeviceUpdateStatusDto deviceUpdateStatusDto) { var device = GetDeviceByName(deviceUpdateStatusDto.Name); Mapper.Map <Device>(deviceUpdateStatusDto); Context.Entry(device).State = EntityState.Modified; }
public async Task <ActionResult> UpdateDeviceStatus(DeviceUpdateStatusDto deviceUpdateStatusDto) { Repo.Update(deviceUpdateStatusDto); if (await Repo.SaveAllAsync()) { return(Ok()); } return(BadRequest("Nie udało sie zaktualizowac statusu")); }