我真正想要的是在 Scott Gu 的博客中将这两个表选择为匿名类型:这里但是,我会满足于这种创建的类型“ActiveLots” 我将两个表连接在一起,并希望能够引用每个表中的列在我的结果集中。
我似乎没有正确理解语法。
Dim pi = From p In dc.Inventories Join i In dc.InventoryItems On p.InventoryItemID _
Equals i.InventoryItemID Where p.LotNumber <> "" _
Select New ActiveLots LotNumber = p.LotNumber, Quantity = p.Quantity, Item = i.Item, Uom = i.UnitofMeasure, Description = i.Description