Ich versuche, diese Abfrage zu beantragen:OData: Reisen Abfrage Fehler Casting komplexe Typen
http://services.odata.org/V4/TripPinService/People('russellwhyte')/AddressInfo/Microsoft.OData.SampleService.Models.TripPin.AirportLocation
Also, ich versuche alle AirportLocation
von People('russellwhyte')
zu bekommen. Allerdings erhalte ich diese Fehlermeldung:
"error": {
"code": "InternalServerError",
"message": "Type cast segment 'Microsoft.OData.SampleService.Models.TripPin.AirportLocation' after a collection which is not of entity type is not allowed.",
"innererror": {...
}
Dies ist das Location
komplexer Typ verwandte Schema:
<ComplexType Name="Location" OpenType="true">
<Property Name="Address" Type="Edm.String" Nullable="false" />
<Property Name="City" Type="Microsoft.OData.SampleService.Models.TripPin.City" Nullable="false" />
</ComplexType>
<ComplexType Name="EventLocation" BaseType="Microsoft.OData.SampleService.Models.TripPin.Location" OpenType="true">
<Property Name="BuildingInfo" Type="Edm.String" />
</ComplexType>
<ComplexType Name="AirportLocation" BaseType="Microsoft.OData.SampleService.Models.TripPin.Location" OpenType="true">
<Property Name="Loc" Type="Edm.GeographyPoint" Nullable="false" SRID="4326" />
</ComplexType>
So Location
komplexer Typ ist der Basistyp von AirportLocation
und EventLocation
.
irgendwelche Ideen?
Können Sie mir bieten jede Was hilft Dokumentation, warum sollte ich eine "GetLocationsOfCnAddress" und eine "GetLocationsOfUsAddress" haben? Auf der anderen Seite, wissen Sie, dass ein Service diese Funktionalität wirklich unterstützt? – Jordi
Sie finden einige Dokumente zum Convention Routing: http://odata.github.io/WebApi/#03-02-built-in-routing-conventions. Aber es erwähnt nicht die Eigentumsform. Vielleicht können Sie auf die Codes verweisen: https://github.com/OData/WebApi/blob/master/src/System.Web.OData/OData/Routing/Conventions/PropertyRoutingConvention.cs#L65-L67 –