Suppose I have 2 tables, table1 and table2, with the common key "id"
If I need an internal join of these two tables using sql, I would do something like
select id, x, y, z from table1 inner join table2 on table1.id = table2.id
Now I get the rows in table 1 that intersect only in table 2.
how to get equivalent in linq wcf data service / odata syntax?
I expect something like:
var q = (from t in svc.Table1.Expand("Table2") where t.Table2.Any() select t) as DataServiceQuery<Table1>;
but that makes me an exception to Any() .
I tried .Join and this is also not supported. I tried .Count , and that didn't work either.
.Intersect looks like it takes up another enumeration, so it doesn't look like what I want ...
I think I am missing something really obvious or simple ...
Edit: this looks like a duplicate How to use OData Expand as a SQL join?
source share