public Release ScheduleRelease(
                ReleaseId newReleaseId,
                String name,
                String description,
                DateTime begins,
                DateTime ends)
        {
            Release release =
                new Release(
                        this.TenantId,
                        this.ProductId,
                        newReleaseId,
                        name,
                        description,
                        begins,
                        ends);

            DomainEventPublisher
                .Instance
                .Publish(new ProductReleaseScheduled(
                        release.TenantId,
                        release.ProductId,
                        release.ReleaseId,
                        release.Name,
                        release.Description,
                        release.Begins,
                        release.Ends));

            return release;
        }
        public void ScheduleFor(Release release)
        {
            AssertionConcern.AssertArgumentNotNull(release, "Release must not be null.");
            AssertionConcern.AssertArgumentEquals(this.TenantId, release.TenantId, "Release must be of same tenant.");
            AssertionConcern.AssertArgumentEquals(this.ProductId, release.ProductId, "Release must be of same product.");

            if (this.IsScheduledForRelease && !this.ReleaseId.Equals(release.ReleaseId))
            {
                UnscheduleFromRelease();
            }

            if (this.Status == BacklogItemStatus.Planned)
            {
                this.Status = BacklogItemStatus.Scheduled;
            }

            this.ReleaseId = release.ReleaseId;

            DomainEventPublisher.Instance.Publish(
                new BacklogItemScheduled(this.TenantId, this.BacklogItemId, release.ReleaseId));
        }