コード例 #1
0
        private Product CreateProduct(int supplierID, string productName)
        {
            Product product = new Product(supplierID, productName);

            product.OrderDetails.AddRange(new OrderDetail[] {
                new OrderDetail(product.ProductID, random.Next(0, 100)),
                new OrderDetail(product.ProductID, random.Next(0, 100)),
                new OrderDetail(product.ProductID, random.Next(0, 100)) });

            return product;
        }
コード例 #2
0
 public void Add(Product product)
 {
     products.Add(product);
 }