public ProductDiscussion(
         DiscussionDescriptor descriptor,
         DiscussionAvailability availability)
 {
     this.Availability = availability;
     this.Descriptor = descriptor;
 }
 public ProductDiscussion NowReady(DiscussionDescriptor descriptor)
 {
     if (descriptor == null || descriptor.IsUndefined)
         throw new ArgumentException("The discussion descriptor must be defined.");
     if (this.Availability != DiscussionAvailability.Requested)
         throw new InvalidOperationException("The discussion must be requested first.");
     return new ProductDiscussion(descriptor, DiscussionAvailability.Ready);
 }
        public static ProductDiscussion FromAvailability(
                DiscussionAvailability availability)
        {
            if (availability == DiscussionAvailability.Ready)
                throw new InvalidOperationException("Cannot be created ready.");

            var descriptor = new DiscussionDescriptor(DiscussionDescriptor.UNDEFINED_ID);

            return new ProductDiscussion(descriptor, availability);
        }
        public void InitiateDiscussion(DiscussionDescriptor descriptor)
        {
            if (descriptor == null)
            {
                throw new InvalidOperationException("The descriptor must not be null.");
            }

            if (this.Discussion.Availability == DiscussionAvailability.Requested)
            {
                this.Discussion = this.Discussion.NowReady(descriptor);

                DomainEventPublisher
                    .Instance
                    .Publish(new ProductDiscussionInitiated(
                            this.TenantId,
                            this.ProductId,
                            this.Discussion));
            }
        }
 public void InitiateDiscussion(DiscussionDescriptor descriptor)
 {
     AssertionConcern.AssertArgumentNotNull(descriptor, "The descriptor must not be null.");
     if (this.Discussion.Availability == DiscussionAvailability.Requested)
     {
         this.Discussion = this.Discussion.NowReady(descriptor);
         DomainEventPublisher.Instance.Publish(
             new BacklogItemDiscussionInitiated(this.TenantId, this.BacklogItemId, this.Discussion));
     }
 }
 public ProductDiscussion(DiscussionDescriptor descriptor, DiscussionAvailability availability)
 {
     AssertionConcern.AssertArgumentNotNull(descriptor, "The descriptor must be provided.");
     this.Availability = availability;
     this.Descriptor = descriptor;
 }
 public BacklogItemDiscussion(DiscussionDescriptor descriptor, DiscussionAvailability availability)
 {
     this.Descriptor = descriptor;
     this.Availability = availability;
 }