public Shop(IShopItemGroup rootCategories, ICollection <IUser> users, ICollection <IManager> managers, ICollection <IOrder> orders) { _rootCategories = rootCategories; _users = users; _managers = managers; _orders = orders; }
protected virtual void Validate(IShopItem shopItem, IShopItemGroup group) { if (shopItem == null) { throw new NullReferenceException("shopItem should be not null"); } else if (group == null) { throw new NullReferenceException("group should be not null"); } }
public void Add(IShopItem shopItem, IShopItemGroup group) { Validate(shopItem, group); group.Add(shopItem); }