コード例 #1
0
        public void Update(DeviceUpdateStatusDto deviceUpdateStatusDto)
        {
            var device = GetDeviceByName(deviceUpdateStatusDto.Name);

            Mapper.Map <Device>(deviceUpdateStatusDto);
            Context.Entry(device).State = EntityState.Modified;
        }
コード例 #2
0
        public async Task <ActionResult> UpdateDeviceStatus(DeviceUpdateStatusDto deviceUpdateStatusDto)
        {
            Repo.Update(deviceUpdateStatusDto);
            if (await Repo.SaveAllAsync())
            {
                return(Ok());
            }

            return(BadRequest("Nie udało sie zaktualizowac statusu"));
        }