private static void SendEmailSequentially(string address) { var wasAddSuccessfull = _emailsQueue.TryAdd( () => NotThreadSafetyEmailSender.SendEmail(address)); if (!wasAddSuccessfull) { throw new InvalidOperationException("Problem with sending an email."); } }
private static void SendEmailDirectly(string address) { NotThreadSafetyEmailSender.SendEmail(address); }