1

我正在使用 ASP.net Web Api 开发 Breeze JS To Dos 应用程序。当我请求资源时,我收到“元数据查询失败:odata/Todos/Metadata;NaN”。但是当我手动请求 /odata/Todos/Metadata 时,它工作正常。你对此有什么想法吗?

4

2 回答 2

6

尝试:

var dataService = new breeze.DataService({
    serviceName: "http://localhost:2099/api/yourcontent/",
    hasServerMetadata: false,
});

var manager = new breeze.EntityManager({ dataService: dataService });
于 2013-04-17T01:25:11.357 回答
2

我发现 datajs 的 MaxDataServiceVersion 标头导致 404...

尝试

var oldClient = OData.defaultHttpClient;
var myClient = {
    request: function (request, success, error) {
        delete request.headers.MaxDataServiceVersion;
        return oldClient.request(request, success, error);
    }
};
OData.defaultHttpClient = myClient;
于 2014-07-06T17:42:47.710 回答