C# OData$扩展URL限制?
当您有大量(本例中为20个)导航属性要扩展时,如何通过服务引用来扩展实体的导航属性?我正在执行以下代码:C# OData$扩展URL限制?,c#,entity-framework-6,odata,wcf-data-services,service-reference,C#,Entity Framework 6,Odata,Wcf Data Services,Service Reference,当您有大量(本例中为20个)导航属性要扩展时,如何通过服务引用来扩展实体的导航属性?我正在执行以下代码: var result = MyEntities.Sample.Expand("Collector,Container,Coordinates...") 这将导致以下URI: http://192.168.0.196/Service.svc/Sample?$expand=Collector,Container,Coordinates,DispositionRequest,Employee,
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.
OData协议目前不支持13个以上的同时扩展属性
从代码中,我们可以看到13不受支持,您想尝试WebAPI/OData V4还是Restier?有趣的是,我真的认为我做错了什么……我想我别无选择,只能使用另一种方法。我将对WebAPI/OData进行一些研究。谢谢