0
我有一個OData URI,我使用$ expand和$ select。OData返回單個節點
http://odataservice.com/TripBookingPrices()?$expand=Trip&$select=TripId,Trip/ItemCode
這是工作,但在結果「跳閘」正在恢復作爲一個集合:
{"d": {"results": [
{
"__metadata": {
"uri": "http://odataservice.com/TripBookingPrices(229)",
"type": "CodeFirstNamespace.TripBookingPrice"
},
"TripId": 46,
"Trip": {
"__metadata": {
"uri": "http://odataservice.com/Trips(46)",
"type": "CodeFirstNamespace.Trip"
},
"ItemCode": "ItemCode1"
}
}
這有什麼辦法可以迫使它返回這樣?:
{"d": {"results": [
{
"__metadata": {
"uri": "http://odataservice.com/TripBookingPrices(229)",
"type": "CodeFirstNamespace.TripBookingPrice"
},
"TripId": 46,
"ItemCode": "ItemCode1"
}