示例#1
0
 public Shop(IShopItemGroup rootCategories, ICollection <IUser> users, ICollection <IManager> managers, ICollection <IOrder> orders)
 {
     _rootCategories = rootCategories;
     _users          = users;
     _managers       = managers;
     _orders         = orders;
 }
示例#2
0
 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");
     }
 }
示例#3
0
 public void Add(IShopItem shopItem, IShopItemGroup group)
 {
     Validate(shopItem, group);
     group.Add(shopItem);
 }