public void JoinProduct(string productId, string productName) { if (this.IsExistedProduct(productId)) { return; } var promotionContainsProduct = new PromotionContainsProduct(productId, productName); this._promotionContainsProducts.Add(promotionContainsProduct); }
protected SingleProductPromotionRule(string promotionId, string title, string containsProductId, string containsProductName) : base(promotionId, title) { if (string.IsNullOrWhiteSpace(containsProductId)) { throw new ArgumentNullException("containsProductId"); } if (string.IsNullOrWhiteSpace(containsProductName)) { throw new ArgumentNullException("containsProductName"); } this._promotionContainsProduct = new PromotionContainsProduct(containsProductId, containsProductName); }