我有一個WebApi OData端點,我用BreezeJS查詢,而且我遇到了json有效負載的問題。當我用BreezeJS查詢端點時,與通過url直接查詢端點相反,json有效負載是〜2x,並且這似乎是因爲響應包含完整的元數據。BreezeJS/WebApi OData最小元數據
例如,微風查詢:
{
"Entity": {
"Id": 3,
"LegacyId": 21,
"Type": "Company",
"odata.id": "http://localhost/odata/Entities(3)",
"odata.type": "Test.Models.Entity"
},
"[email protected]": "http://localhost/odata/Answers(2)/Entity",
"Question": {
"Id": 1,
"Name": "Name",
"Type": "string",
"odata.id": "http://localhost/odata/Questions(1)",
"odata.type": "Test.Models.Question"
},
"[email protected]": "http://localhost/odata/Answers(2)/Question",
"EntityId": 3,
"Id": 2,
"Modified": "2015-05-22T14:56:26.477",
"[email protected]": "Edm.DateTime",
"QuestionId": 1,
"Value": "Some Company Name",
"odata.id": "http://localhost/odata/Answers(2)",
"odata.type": "Test.Models.Answer"
}
對比與查詢http://localhost/odata/Answers(3):
{
"Entity": {
"Id": 3,
"LegacyId": 21,
"Type": "Company"
},
"Question": {
"Id": 1,
"Name": "Name",
"Type": "string"
},
"EntityId": 3,
"Id": 2,
"Modified": "2015-05-22T14:56:26.477",
"QuestionId": 1,
"Value": "Some Company Name"
}
有沒有辦法通過BreezeJS查詢返回的最小的元數據?