public void ThrowIfPublishingBroken(ExpertProfile p) { var check = new ProfileCheckBeforePublish(p); var isOk = p.IsPublished && check.IsReadyForPublish; if (!isOk) { throw new ProfileIsNotPublishedException(check); } }
public ProfileIsNotPublishedException(ProfileCheckBeforePublish profileCheck) : base("Can not publish!") { this._profileCheck = profileCheck; }