コード例 #1
0
        public async Task Put(string id, [FromBody] EmergencyAccessUpdateRequestModel model)
        {
            var emergencyAccess = await _emergencyAccessRepository.GetByIdAsync(new Guid(id));

            if (emergencyAccess == null)
            {
                throw new NotFoundException();
            }

            var userId = _userService.GetProperUserId(User);
            await _emergencyAccessService.SaveAsync(model.ToEmergencyAccess(emergencyAccess), userId.Value);
        }
コード例 #2
0
        public async Task Put(Guid id, [FromBody] EmergencyAccessUpdateRequestModel model)
        {
            var emergencyAccess = await _emergencyAccessRepository.GetByIdAsync(id);

            if (emergencyAccess == null)
            {
                throw new NotFoundException();
            }

            var user = await _userService.GetUserByPrincipalAsync(User);

            await _emergencyAccessService.SaveAsync(model.ToEmergencyAccess(emergencyAccess), user);
        }