Example #1
0
        private void RemoveFromNewsletter(INewsletterCommand command, Newsletter newsletter)
        {
            if (!IsEmailTaken(command.Email))
            {
                throw new EmailIsTakenException(NotificationExceptionMessage.EmailIsNotExist);
            }

            newsletter.NotIncluded = true;
        }
Example #2
0
        private void AddToNewsletter(INewsletterCommand command, Newsletter newsletter)
        {
            if (IsEmailTaken(command.Email))
            {
                throw new EmailIsTakenException(NotificationExceptionMessage.EmailIsAlreadyInNewsletter);
            }

            newsletter.Email       = command.Email;
            newsletter.NotIncluded = false;
        }