In C#, I need to retrieve a List<Object> using linq with lamba expression.
This is the case:
List<TAB1> itemList =
context.TAB1.Join(
context.TAB2, itm => itm.ItemCode, bcd => bcd.ItemCode, (itm, bcd) => new { ITM = itm, BCD = bcd })
.Where(i => i.ITM.ItemCode == (itemCode ?? i.ITM.ItemCode))
.Where(i => i.BCD.BcdCode.Contains(codeBars ?? i.BCD.BcdCode)).ToList();
At the moment that retrieves me a list<AnonymousType>, but I need a List<TAB1> that only return the values of that table.
EDIT:
The returned List<TAB1> needs to replace one property (TAB1.Barcode) with TAB2.BcdCode (it's the same type). How can I do it?