Reputation: 5962
This is my sql query
.
select category from category where id in(select cid from subcategory)
I want to write this in linq
. how can I write this .
there is sample which i know , but this I'm unable to write this for my requirement
from n in objvar
where new[] { "Amit", "Kumar", "XYZ" }.Contains(n.hello)
select n
Upvotes: 0
Views: 58
Reputation: 10246
A working solution would be
var res= from c in Category
join
s in SubCategory on c.id equals s.cid
select c;
Upvotes: 1