public async Task <bool> UpdateAsync(Guid id, DeviceForUpdateDto deviceForUpdate)
        {
            var device = await _repositoryManager.Device.GetDeviceAsync(CurrentUserId, id, true);

            _mapper.Map(deviceForUpdate, device);

            _repositoryManager.Device.UpdateDevice(device);
            await _repositoryManager.SaveAsync();

            return(device != null);
        }
Пример #2
0
        public async Task <IActionResult> UpdateDevice(Guid id, [FromBody] DeviceForUpdateDto projectForUpdate)
        {
            var result = await _deviceService.UpdateAsync(id, projectForUpdate);

            return(result ? NoContent() : NotFound());
        }