private string CreateSecurityId()

in src/Services/User/User.API/Services/HealthSecurityService.cs [62:81]


        private string CreateSecurityId(int codeLength, string comment)
        {
            var trials = 100;
            string securityId;
            bool isCreated;
            do
            {
                securityId = GenerateSecurityId(codeLength);
                isCreated = medicalRegistrationRepository.TryCreateSecurityId(securityId, comment);
            } while (!isCreated && --trials > 0);

            if (!isCreated)
            {
                logger.LogError("Cannot create security id - all trials failed.");

                throw new ApplicationException("Cannot generate security ids. Try again later.");
            }

            return securityId;
        }