예제 #1
0
 /// <summary>
 /// 用于向 Products EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToProducts(Product product)
 {
     base.AddObject("Products", product);
 }
예제 #2
0
 /// <summary>
 /// 创建新的 Product 对象。
 /// </summary>
 /// <param name="productID">ProductID 属性的初始值。</param>
 /// <param name="productName">ProductName 属性的初始值。</param>
 /// <param name="discontinued">Discontinued 属性的初始值。</param>
 public static Product CreateProduct(global::System.Int32 productID, global::System.String productName, global::System.Boolean discontinued)
 {
     Product product = new Product();
     product.ProductID = productID;
     product.ProductName = productName;
     product.Discontinued = discontinued;
     return product;
 }