Пример #1
0
        private static void SendEmailSequentially(string address)
        {
            var wasAddSuccessfull = _emailsQueue.TryAdd(
                () => NotThreadSafetyEmailSender.SendEmail(address));

            if (!wasAddSuccessfull)
            {
                throw new InvalidOperationException("Problem with sending an email.");
            }
        }
Пример #2
0
 private static void SendEmailDirectly(string address)
 {
     NotThreadSafetyEmailSender.SendEmail(address);
 }