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; }
private void SendEmailForTimedOutProcess(Product product) { //TODO: implement }
private void RequestProductDiscussionFor(Product product) { ApplicationServiceLifeCycle.Begin(); try { product.RequestDiscussion(this.RequestDiscussionIfAvailable()); this._productRepository.Save(product); ApplicationServiceLifeCycle.Success(); } catch (Exception ex) { ApplicationServiceLifeCycle.Fail(ex); } }