サーバ:標準VS 2015ジェネレータで生成されたOdataコントローラ。
// GET: odata/MyEntities
[EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All)]
public IQueryable<Models.Odata. MyEntity> GetMyEntities()
{
return db.MyEntities;
}
クライアント:KendoUI
var ds = new kendo.data.HierarchicalDataSource({
type: "odata-v4",
transport: {
read: {
url: "odata/EndPoints",
dataType: "json"
}
},
schema: {
model: {
id: "Id",
}
}
});
が要求:
http://localhost:44444/odata/MyEntities?$format=json
- リターンが期待いただきました、 しかし
http://localhost:44444/odata/MyEntities?$format=json&$count=true
は - エラーを生成します。
{
"odata.error":{
"code":"","message":{
"lang":"en-US","value":"The query parameter '$count' is not supported."
}
}
}
私はAppStartで標準設定を使用しました。それは何ですか?
なぜ=は真ですか? http://www.odata.org/getting-started/basic-tutorial/#count –
$ countをtrueにすると同じ結果が得られます – idm
これは、どのデータサービスのバージョンが受け継がれていますか? https://msdn.microsoft.com/en-us/library/azure/gg312156.aspx#DetermineDataServiceVersion –