/// <summary> /// 用于向 Products EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToProducts(Product product) { base.AddObject("Products", product); }
/// <summary> /// 创建新的 Product 对象。 /// </summary> /// <param name="id">Id 属性的初始值。</param> /// <param name="name">Name 属性的初始值。</param> /// <param name="userId">UserId 属性的初始值。</param> /// <param name="createdAt">CreatedAt 属性的初始值。</param> /// <param name="modifiedAt">ModifiedAt 属性的初始值。</param> /// <param name="number">Number 属性的初始值。</param> public static Product CreateProduct(global::System.Int32 id, global::System.String name, global::System.Int32 userId, global::System.DateTime createdAt, global::System.DateTime modifiedAt, global::System.String number) { Product product = new Product(); product.Id = id; product.Name = name; product.UserId = userId; product.CreatedAt = createdAt; product.ModifiedAt = modifiedAt; product.Number = number; return product; }