微风inlineCount未定义 [英] Breeze inlineCount is undefined

查看:49
本文介绍了微风inlineCount未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查询:

var query = entityQuery.from('Items').where(fullPredicate).orderBy(sortingColumn + ' ' + ordering).skip(numOfEntities * (pageNum - 1)).take(numOfEntities).inlineCount();

return manager.executeQuery(query)
                .then(querySucceeded)
                .fail(queryFailed);

控制器看起来像这样:

[Queryable(AllowedQueryOptions = AllowedQueryOptions.All,
                    AllowedFunctions = AllowedFunctions.AllFunctions,
                    MaxNodeCount = 10000)]
        [HttpGet]
        public IQueryable<Item> Items()
        {
            return _contextProvider.Context.Items.Include("A").Include("B").Include("C");
        }

响应是纯JSON,包含所有项目和链接的(包含)项目(A, B和C),但没有inlineCount。在querySucceeded中读取数据时,有一个名为inlineCount的参数,但设置为undefined。

Response is pure JSON with all Items and linked (Included) items (A, B and C), but without inlineCount. While reading data in querySucceeded, there is a parameter called inlineCount but is set to undefined.

我尝试将以下内容添加到web.config中,但没有这样做

I've tried adding the following to web.config, but it didn't help.

<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
    <add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
    <add name="Access-Control-Expose-Headers" value="X-InlineCount" />
  </customHeaders>
</httpProtocol>

也从1.4.0升级到1.4.2,但没有帮助。

Upgraded from 1.4.0 to 1.4.2 as well, but didn't help.

推荐答案

删除以下内容可以解决此问题。可能存在一个错误,其中inlineCount不包含在AllFunction或其他任何东西中。

Removing the following solved the problem. There is probably a bug where inlineCount is not included in AllFunctions or something.

[Queryable(AllowedQueryOptions = AllowedQueryOptions.All,
    AllowedFunctions = AllowedFunctions.AllFunctions,
    MaxNodeCount = 10000)]

这篇关于微风inlineCount未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆