/// <summary> /// 找到某个商品在这个仓库中的库存项 /// /// 如果不存在,则创建一个对应项。 /// </summary> /// <param name="product"></param> /// <returns></returns> public StorageProduct FindOrCreateItem(Product product) { var children = this.StorageProductList; var item = children.Cast <StorageProduct>().FirstOrDefault(e => e.ProductId == product.Id); if (item != null) { return(item); } item = new StorageProduct { Product = product }; children.Add(item); return(item); }
public void Insert(int index, StorageProduct entity) { base.Insert(index, entity); }
public int IndexOf(StorageProduct entity) { return(base.IndexOf(entity)); }
public bool Contains(StorageProduct entity) { return(base.Contains(entity)); }
public void Add(StorageProduct entity) { base.Add(entity); }
public bool Remove(StorageProduct entity) { return(base.Remove(entity)); }