问题
If I try to sort my entities by navigation property, I get the following error:
"'NHibernate.Linq.NhQueryable<CdT.EAI.Business.Entities.Request>' does not contain a definition for 'Include'"
The ODATA query is:
Requests?$orderby=Client%2FName&$top=10&$expand=Client&$inlinecount=allpages
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.
I use the latest version of breeze (1.4.7)
Can you confirm the problem ?
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...
回答1:
This is a bug. MS changed some of the OData handling in WebApi 2, and our NH support didn't change with it.
The fix is in 1.4.8 (expected to be out tomorrow). We apologize for the inconvenience.
来源:https://stackoverflow.com/questions/20562850/breeze-sorting-by-navigation-property-fails-with-nhibernate-and-webapi-2