public ProductDiscussion( DiscussionDescriptor descriptor, DiscussionAvailability availability) { this.Availability = availability; this.Descriptor = descriptor; }
public static BacklogItemDiscussion FromAvailability(DiscussionAvailability availability) { if(availability==DiscussionAvailability.Ready) { throw new ArgumentException("Cannot be created ready."); } return new BacklogItemDiscussion(new DiscussionDescriptor(DiscussionDescriptor.UndefinedId), availability); }
public Product( TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability discussionAvailability) { this.TenantId = tenantId; // must precede productOwnerId for compare this.Description = description; this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability); this.DiscussionInitiationId = null; this.Name = name; this.ProductId = productId; this.ProductOwnerId = productOwnerId; // TODO: validation currently missing DomainEventPublisher .Instance .Publish(new ProductCreated( this.TenantId, this.ProductId, this.ProductOwnerId, this.Name, this.Description, this.Discussion.Availability)); }
public Product( TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability discussionAvailability) { this.TenantId = tenantId; // must precede productOwnerId for compare this.Description = description; this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability); this.DiscussionInitiationId = null; this.Name = name; this.ProductId = productId; this.ProductOwnerId = productOwnerId; // TODO: validation currently missing DomainEventPublisher .Instance .Publish(new ProductCreated( this.TenantId, this.ProductId, this.ProductOwnerId, this.Name, this.Description, this.Discussion.Availability)); }
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 static BacklogItemDiscussion FromAvailability(DiscussionAvailability availability) { if (availability == DiscussionAvailability.Ready) { throw new ArgumentException("Cannot be created ready."); } return(new BacklogItemDiscussion( new DiscussionDescriptor(DiscussionDescriptor.UNDEFINED_ID), availability)); }
public static ProductDiscussion FromAvailability( DiscussionAvailability availability) { if (availability == DiscussionAvailability.Ready) { throw new InvalidOperationException("Cannot be created ready."); } var descriptor = new DiscussionDescriptor(DiscussionDescriptor.UndefinedId); return(new ProductDiscussion(descriptor, availability)); }
public ProductCreated(TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability availability) { this.TenantId = tenantId; this.ProductId = productId; this.ProductOwnerId = productOwnerId; this.Name = name; this.Description = description; this.Availability = availability; this.EventVersion = 1; this.OccurredOn = DateTime.Now; }
public void RequestDiscussion(DiscussionAvailability availability) { if (Discussion.Availability != DiscussionAvailability.Ready) { Discussion = BacklogItemDiscussion.FromAvailability(availability); DomainEventPublisher.Instance.Publish( new BacklogItemDiscussionRequested( TenantId, ProductId, BacklogItemId, availability == DiscussionAvailability.Requested)); } }
public Product(TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability discussionAvailability) { this.TenantId = tenantId; this.ProductId = productId; this.ProductOwnerId = productOwnerId; this.Name = name; this.Description = description; this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability); this.DiscussionInitiationId = null; this._backlogItems = new HashSet<ProductBacklogItem>(); DomainEventPublisher.Instance.Publish(new ProductCreated(this.TenantId, this.ProductId, this.ProductOwnerId, this.Name, this.Description, this.Discussion.Availability)); }
public ProductCreated( TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability availability) { this.Availability = availability; this.Description = description; this.EventVersion = 1; this.Name = name; this.OccurredOn = DateTime.Now; this.ProductId = productId; this.ProductOwnerId = productOwnerId; this.TenantId = tenantId; }
public ProductCreated( TenantId tenantId, ProductId productId, ProductOwnerId productOwnerId, string name, string description, DiscussionAvailability availability) { Availability = availability; Description = description; EventVersion = 1; Name = name; OccurredOn = DateTime.Now; ProductId = productId; ProductOwnerId = productOwnerId; TenantId = tenantId; }
public void RequestDiscussion(DiscussionAvailability discussionAvailability) { if (this.Discussion.Availability != DiscussionAvailability.Ready) { this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability); DomainEventPublisher .Instance .Publish(new ProductDiscussionRequested( this.TenantId, this.ProductId, this.ProductOwnerId, this.Name, this.Description, this.Discussion.Availability == DiscussionAvailability.Requested)); } }
public string NewProductWith(string tenantId, string productOwnerId, string name, string description, DiscussionAvailability discussionAvailability) { TenantId tenant = new TenantId(tenantId); ProductId productId = default (ProductId); ApplicationServiceLifeCycle.Begin(); try { productId = this._productRepository.GetNextIdentity(); ProductOwner productOwner = this._productOwnerRepository.Get(tenant, productOwnerId); Product product = new Product(tenant, productId, productOwner.ProductOwnerId, name, description, discussionAvailability); this._productRepository.Save(product); ApplicationServiceLifeCycle.Success(); } catch (Exception ex) { ApplicationServiceLifeCycle.Fail(ex); } //TODO: handle null properly return productId.Id; }
public BacklogItemDiscussion(DiscussionDescriptor descriptor, DiscussionAvailability availability) { this.Descriptor = descriptor; this.Availability = availability; }
public void RequestDiscussion(DiscussionAvailability discussionAvailability) { if(this.Discussion.Availability!=DiscussionAvailability.Ready) { this.Discussion = ProductDiscussion.FromAvailability(discussionAvailability); DomainEventPublisher.Instance.Publish(new ProductDiscussionRequested(this.TenantId, this.ProductId, this.ProductOwnerId, this.Name, this.Description, this.Discussion.Availability == DiscussionAvailability.Requested)); } }
public ProductDiscussion(DiscussionDescriptor descriptor, DiscussionAvailability availability) { AssertionConcern.AssertArgumentNotNull(descriptor, "The descriptor must be provided."); Availability = availability; Descriptor = descriptor; }
string NewProductWith(string tenantId, string productOwnerId, string name, string description, DiscussionAvailability discussionAvailability) { var tid = new TenantId(tenantId); var productId = default(ProductId); ApplicationServiceLifeCycle.Begin(); try { productId = this.productRepository.GetNextIdentity(); var productOwner = this.productOwnerRepository.Get(tid, productOwnerId); var product = new Product(tid, productId, productOwner.ProductOwnerId, name, description, discussionAvailability); this.productRepository.Save(product); ApplicationServiceLifeCycle.Success(); } catch (Exception ex) { ApplicationServiceLifeCycle.Fail(ex); } // TODO: handle null properly return(productId.Id); }
public void RequestDiscussion(DiscussionAvailability availability) { if (this.Discussion.Availability != DiscussionAvailability.Ready) { this.Discussion = BacklogItemDiscussion.FromAvailability(availability); DomainEventPublisher.Instance.Publish( new BacklogItemDiscussionRequested( this.TenantId, this.ProductId, this.BacklogItemId, availability == DiscussionAvailability.Requested)); } }
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; }