public async Task UpdateAsync(ISwiftCredentials swiftCredentials)
        {
            bool updated = await _swiftCredentialsRepository.UpdateAsync(swiftCredentials);

            if (!updated)
            {
                throw new SwiftCredentialsNotFoundException("Swift credentials not found")
                      {
                          RegulatorId = swiftCredentials.RegulatorId,
                          AssetId     = swiftCredentials.AssetId
                      };
            }
        }
Пример #2
0
        public async Task UpdateAsync(SwiftCredentials swiftCredentials)
        {
            var existingSwiftCredentials = await _swiftCredentialsRepository.GetByIdAsync(swiftCredentials.Id);

            if (existingSwiftCredentials == null)
            {
                throw new SwiftCredentialsNotFoundException(swiftCredentials.Id);
            }

            await _swiftCredentialsRepository.UpdateAsync(swiftCredentials);

            await _clientSwiftCredentialsCache.ClearAsync("Swift credentials updated");

            await _log.WriteInfoAsync(nameof(SwiftCredentialsService), nameof(UpdateAsync),
                                      swiftCredentials.ToJson(), "Swift credentials updated");
        }