How do i get an inner join in a WCF Data Service

眉间皱痕 提交于 2019-12-01 14:01:51
CodeMonkeyKing

Take a look at the answers to this type of question. The current version of WCF Data Services (OData) does not support joins even if your underlying data contract does (i.e. if you're layering on top of Entity Framework 4 for instance).

The more recent releases of WCF Data Services now include Any/All support. See What's New in WCF Data Services 5.0

Vitek Karas MSFT

Currently the OData protocol (and thus WCF Data Services) doesn't support any/all operations. It also doesn't support arbitrary joins, although some joins can be expressed as navigations. Your query is currently not supported, but we're looking into adding support for the any/all operations. Take a look at this proposal if that would fulfill your needs: http://www.odata.org/blog/support-for-any-and-all

Is WCF in play here? To link two objects from two tables/lists, I'd do this:

var result = 
  from o1 in Table1
  join o2 in Table2 on o2.id equals o1.id
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!