我有 2 张桌子
VendorProduct vp = new VendorProduct
{
VendorPartNo = txtVdrPartNoOrg10.Value
};
和
Product p = new Product
{
MfgPartNo = lbMfgPartNoOrg10.Text,
Description = txtDesOrg10.Text,
Weight = Convert.ToDecimal(txtWeightOrg10.Value),
VendorProducts = new System.Collections.ObjectModel.Collection<VendorProduct>() { vp }
};
如何将Insert
数据放入这些表中,例如
DataContext.AddObject("Product", p);
DataContext.SaveChanges();
怎么设置链接??