Ada*_*dam 8 odata asp.net-web-api breeze
我最近更新了所有我的nuget软件包到最新的EF6,breeze 1.4.5,system.web.http.odata 5.0.0.0,以及所有其他可用的好位.
现在,如果一个查询包含像xyz这样的扩展,我会收到如下错误:
A first chance exception of type 'Microsoft.Data.OData.ODataException' occurred in System.Web.Http.OData.dll
Additional information: The request includes a $expand path which is too deep. The maximum depth allowed is 2. To increase the limit, set the 'MaxExpansionDepth' property on QueryableAttribute or ODataValidationSettings.
Run Code Online (Sandbox Code Playgroud)
我查看了建议的修复程序.如果我在查询的breeze'端点'上添加Queryable属性,它似乎会导致各种其他问题.我的猜测是它会干扰微风的预期行为,并以不同的方式格式化结果.
然后,我通过GlobalConfiguration.Configuration ...查看了使用HttpConfiguration EnableQuerySupport扩展方法,但似乎没有效果(请参阅支持OData查询选项)
有没有人知道如何更改默认的webapi行为?
谢谢.
mab*_*ulu 20
你需要在你的breeze控制器IQueryable方法中添加一个BreezeQueryable属性,就像这样......
[BreezeQueryable(MaxExpansionDepth = 3)]
public IQueryable<Customer> Customers()
{
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3605 次 |
| 最近记录: |