2
votes

How do you expand navigation properties of an entity through a service reference when you have a lot (20 in this case) of navigation properties to expand? I am executing the following code:

var result = MyEntities.Sample.Expand("Collector,Container,Coordinates...") 

this results in the following 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

The error I am getting is:

$expand does not support '19' properties expanded simultaneously on the same segment.
1
from the code github.com/OData/odata.net/blob/ODATAV3/WCFDataService/Service/…, we can see more then 13 is not supported, would you like to try WebAPI/OData V4 or Restier? - Fan Ouyang
Interesting, I really thought I was doing something wrong...I suppose I will have no choice but to use a different method. I will do some research into WebAPI/OData. Thanks! - jjf1978

1 Answers

0
votes

It looks like no more than 13 simultaneously expanded properties is not currently supported in the OData protocol.

https://github.com/OData/odata.net/blob/ODATAV3/WCFDataService/Service/System/Data/Services/WebUtil.cs#L986-L990