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

            newsletter.NotIncluded = true;
        }
示例#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;
        }