【发布时间】:2012-05-25 06:37:37
【问题描述】:
我在 Entity Framework 4.1 中使用 WCF 数据服务
我有 2 个具有多对多关系的表。 我正在尝试基于子值获取实体。
Table 1 (Suppliers) -> ID (PrimaryKey) ,Name ,isEnabled ,Timestamp
Table 2 (Categories) -> RGID (PrimaryKey) , Name, etc....
我试过这样写 URI。 我的目标是检索所有具有 RGID = 3 的类别的供应商。
http://localhost/WCFS/WCFService.svc/Suppliers?$expand=Categories&$filter=RGID eq 3
像这样
http://localhost/WCFS/WCFService.svc/Suppliers?$expand=Categories&$filter=Categories/RGID eq 3
运气不好。 对于我得到的第二次尝试
The 'RGID ' is not allowed at position 11. Member access or specifying a type identifier on a resource set reference is not allowed.
那怎么办???
谢谢
【问题讨论】:
-
您是否通过 URL 传递 SQL 命令?您的 RGID eq 3,您是否将其粘贴到某个查询中?
标签: wcf linq entity-framework wcf-data-services