【发布时间】:2009-07-23 10:04:10
【问题描述】:
我正在使用 ADO.Net 数据服务并有一个服务操作,最终将某些 linq 的结果返回到实体语句。作为这些 Linq 语句的一部分,有一个 .Include("NavProp") 来包含一个子对象。运行此服务操作时,它似乎不会返回扩展的包含。有谁知道这是为什么或如何解决?是否可以在对服务操作的调用中添加关键字来扩展该子对象? (我试过 $expand=subObject 但这似乎不起作用 - 错误的请求)。
我想最终得到: 1.) 服务操作中返回 .Include 的 linq 语句的语法(我很确定这是不可能的)
something like:
(from c in context.MyObj.Include("SubObj")
select c).ToList()
(this works inside the service operation, but doesn't provide the SubObj on the client side)
或
2.) 服务操作请求扩展子对象的语法
something like: http://localhost/MyDataService/MyDataService.svc/ServiceOp1?param1=234$expand=SubObj (note: this doesn't work)
【问题讨论】:
标签: linq wcf-data-services service-operations