轻而易举:NHibernate和WebAPI 2无法按导航属性进行排序 [英] breeze: sorting by navigation property fails with NHibernate and WebAPI 2

查看:65
本文介绍了轻而易举:NHibernate和WebAPI 2无法按导航属性进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我尝试按导航属性对实体进行排序,则会出现以下错误:

If I try to sort my entities by navigation property, I get the following error:

'NHibernate.Linq.NhQueryable< CdT .EAI.Business.Entities.Request>'不包含'Include'的定义

ODATA查询为:

请求?$ orderby = Client%2FName& $ top = 10& $ expand = Client& $ inlinecount = allpages

其中Client是Request实体的导航属性,而Client.Name是显示在我尝试排序的网格中的属性。

Where Client is a navigation property of the Request entity, and Client.Name is the property displayed in the grid I'm trying to sort.

我使用的是最新版本的微风(1.4.7)

I use the latest version of breeze (1.4.7)

您能确认问题吗?

编辑
我只是意识到,如果我降级到WEBAPI v1,则不会出现此错误。似乎仅在WEBAPI 2上才发生...

EDIT I just realized that if I downgrade to WEBAPI v1, then I don't get this error. It seems to occur only with WEBAPI 2...

推荐答案

这是一个错误。 MS更改了WebApi 2中的一些OData处理,并且我们的NH支持也没有改变。

This is a bug. MS changed some of the OData handling in WebApi 2, and our NH support didn't change with it.

此修复程序在1.4.8中(预计明天发布)。对于给您带来的不便,我们深表歉意。

The fix is in 1.4.8 (expected to be out tomorrow). We apologize for the inconvenience.

这篇关于轻而易举:NHibernate和WebAPI 2无法按导航属性进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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