Sunucu: Standart VS 2015 jeneratörü ile oluşturulan oda denetleyicileri.
// GET: odata/MyEntities
[EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All)]
public IQueryable<Models.Odata. MyEntity> GetMyEntities()
{
return db.MyEntities;
}
Müşteri: KendoUI ürünü
var ds = new kendo.data.HierarchicalDataSource({
type: "odata-v4",
transport: {
read: {
url: "odata/EndPoints",
dataType: "json"
}
},
schema: {
model: {
id: "Id",
}
}
});
İstek:
http://localhost:44444/odata/MyEntities?$format=json
- Beklenen neyin döner, ama
http://localhost:44444/odata/MyEntities?$format=json&$count=true
- üretir hatası:
{
"odata.error":{
"code":"","message":{
"lang":"en-US","value":"The query parameter '$count' is not supported."
}
}
}
AppStart'ta standart ayarları kullandım. Bu ne?
Neden = true? http://www.odata.org/getting-started/basic-tutorial/#count –
$ true değeri olmadan aynı sonucu verir – idm
Hangi veri hizmeti sürümü geçiyor? https://msdn.microsoft.com/en-us/library/azure/gg312156.aspx#DetermineDataServiceVersion –