Lambda join使用方式
f.Spec.Contains("Ver") 等同於 Spec like '%Ver %'
.Take(50) -撈出50筆
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | var ItemNumList = db.BOMMD.Join ( db.INVMB, BOMMD => BOMMD.MD003, INVMB => INVMB.MB001, (BOMMD,INVMB) => new { ItemNum = BOMMD.MD001, ElementItemNum = INVMB.MB001, ItemName = INVMB.MB002, Spec = INVMB.MB003 } ) .Where(f => f.ItemNum == itemNum && f.Spec.Contains("Ver")) .OrderBy(f =>f.ItemNum) .Take(50) .ToList(); |
沒有留言:
張貼留言