/// <summary> /// 用于向 OrderDetails EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToOrderDetails(OrderDetail orderDetail) { base.AddObject("OrderDetails", orderDetail); }
/// <summary> /// 创建新的 OrderDetail 对象。 /// </summary> /// <param name="orderID">OrderID 属性的初始值。</param> /// <param name="productID">ProductID 属性的初始值。</param> /// <param name="unitPrice">UnitPrice 属性的初始值。</param> /// <param name="quantity">Quantity 属性的初始值。</param> /// <param name="discount">Discount 属性的初始值。</param> public static OrderDetail CreateOrderDetail(global::System.Int32 orderID, global::System.Int32 productID, global::System.Decimal unitPrice, global::System.Int16 quantity, global::System.Single discount) { OrderDetail orderDetail = new OrderDetail(); orderDetail.OrderID = orderID; orderDetail.ProductID = productID; orderDetail.UnitPrice = unitPrice; orderDetail.Quantity = quantity; orderDetail.Discount = discount; return orderDetail; }