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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Deepak SainiPosted Mar 27, 2015, 12:15 AM
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.
NitinPosted Mar 26, 2015, 8:52 AM
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.