2
當您有很多(本例中爲20個)導航屬性展開時,如何通過服務參考擴展實體的導航屬性?我執行以下代碼:
var result = MyEntities.Sample.Expand("Collector,Container,Coordinates...")
這導致以下URI:
http://192.168.0.196/Service.svc/Sample?$expand=Collector,Container,Coordinates,DispositionRequest,Employee,EstimatedSampleVolume,Facility,PreparationSize,Priority,Product,SourceLocation,SampleClassification,Unit,Vendor,Unit,WorkOrder,SampleType,Subject,Site,State
我得到的錯誤是:
$expand does not support '19' properties expanded simultaneously on the same segment.
從代碼https://github.com/OData/odata.net/blob/ODATAV3/WCFDataService/Service/System/Data/Services/WebUtil.cs#L986-L990,我們可以看到多於13不支持,你想嘗試WebAPI/OData V4還是Restier? –
有趣的是,我真的以爲我做錯了什麼......我想我會別無選擇,只能用不同的方法。我將對WebAPI/OData進行一些研究。謝謝! – jjf1978