Dear All,
when i join two table than we wont to pic the column of both table with column attribute mapping in linq.
sourabh
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
NitinRank #455 · 5.5K reputationPosted Mar 26, 2015, 4:52 AM EDT
You need to define anonymous type for this. For ex:
var result= from x in tableA
join y in tableB on y.id equals x.id
select new
{
x.FieldNameA,
x.FieldNameB,
y.FieldNameA,
y.FieldNameB
};
Here new and the starting braces are the anonymous types. We can use this to achieve the result.
Deepak SainiRank #2,411 · 586 reputationPosted Mar 26, 2015, 8:15 PM EDT
you r right if i am not using list of a particular table.
i am using list and i am getting one table column in this list and i wont to getting second table column in this table with column attribute.give me some reason on that.