I have two tables say A and B. A cols are GUID, someintVar, someMoreIntvar B col are GUID, someItemNO, SomeItemDesc
Now for one GUID I will have only one row in Table A. But I can have multiple rows for the same GUID. Now I want to query the database based on GUID and select values in a class. This class will have a list that will hold different rows coming from the second table. How can I do it?
Right Now I am getting many items in the result based on how many rows are there in the second table for that GUID.
var itemColl = from p in db.A
join item in db.B on p.CardID equals item.CardID
where p.CardID == "some GUID"
select new
{
p.CardID,
p.secondCol,
p.ThirdCol,
item.ItemNo // How to add them in a collection or list.
};