我正在使用ADO.Net數據服務並且有一個服務操作,最終將某些linq的結果返回給實體語句。作爲Linq聲明的一部分,有一個.Include(「NavProp」)包含一個子對象。運行此服務操作時,它似乎不會返回該展開的包含。有誰知道爲什麼這是或如何解決這個問題?是否可以在對服務操作的調用中添加關鍵字來擴展該子對象? (我試過$ expand = subObject,但似乎不工作 - 錯誤的請求)。如何使用「包含」ADO.Net數據服務的服務操作
我想跟要麼結束:在返回在.include也是一個服務操作的LINQ聲明 1)語法(我敢肯定,這是不可能的)
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)