private void RemoveFromNewsletter(INewsletterCommand command, Newsletter newsletter) { if (!IsEmailTaken(command.Email)) { throw new EmailIsTakenException(NotificationExceptionMessage.EmailIsNotExist); } newsletter.NotIncluded = true; }
private void AddToNewsletter(INewsletterCommand command, Newsletter newsletter) { if (IsEmailTaken(command.Email)) { throw new EmailIsTakenException(NotificationExceptionMessage.EmailIsAlreadyInNewsletter); } newsletter.Email = command.Email; newsletter.NotIncluded = false; }