【发布时间】:2013-08-14 07:34:43
【问题描述】:
当我对一个查询调用 inlineCount() 时,该查询既按相关属性排序,又对查询执行 take,inlineCount 等于传递给 take() 的参数。例如,以下查询返回正确的 inlineCount:
testFunc = function () {
EntityQuery.from('Residents')
.take(10)
.inlineCount()
.using(manager).execute()
.then(function (data) {
console.log(data.inlineCount, data); //logs correct value
});
}
但是当我按如下方式向查询中添加排序时:
testFuncOrdering = function () {
EntityQuery.from('Residents')
.orderBy('user.firstName')
.take(10)
.inlineCount()
.using(manager).execute()
.then(function (data) {
console.log(data.inlineCount, data); //logs 10
});
}
inlineCount 是 10,或者我传递的任何值
这是我的控制器操作:
[HttpGet]
public IQueryable<UserDetail> Residents()
{
return _context.Context.UserDetails
.Where(x => _aptIds.Contains(x.User.UserDetail.ApartmentComplexId))
.Where(x => x.Discriminator == UserDetail.Resident);
}
这个错误似乎与 1.4.0 中修复的错误相似,但我得到的不是 inlineCount 的 null/undefined,而是取值。如有必要,我可以提供我的元数据。任何帮助表示赞赏,谢谢。
【问题讨论】:
标签: breeze