asp.net-web-api – MaxExpansionDepth,带有最新的webapi和微风
发布时间:2020-12-15 20:50:00 所属栏目:asp.Net 来源:网络整理
导读:我最近更新了我的所有nuget软件包到最新的EF6,breeze 1.4.5,system.web.http.odata 5.0.0.0,以及所有其他可用的好位. 现在,有一个查询包含像x.y.z这样的扩展,我得到如下错误: A first chance exception of type 'Microsoft.Data.OData.ODataException' occu
我最近更新了我的所有nuget软件包到最新的EF6,breeze 1.4.5,system.web.http.odata 5.0.0.0,以及所有其他可用的好位.
现在,有一个查询包含像x.y.z这样的扩展,我得到如下错误: 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. 我查看了建议的修复程序.如果我在查询的breeze’端点’上添加一个Queryable属性,它似乎会导致各种其他问题.我的猜测是它会干扰微风的预期行为,并以不同的方式格式化结果. 然后,我通过GlobalConfiguration.Configuration …查看了使用HttpConfiguration EnableQuerySupport扩展方法,但似乎没有效果(参见Supporting OData Query Options) 有没有人知道如何更改默认的webapi行为? 谢谢. 解决方法
你需要在你的breeze控制器IQueryable方法中添加一个BreezeQueryable属性,就像这样……
[BreezeQueryable(MaxExpansionDepth = 3)] public IQueryable<Customer> Customers() { ... } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 如何在ZedGraph中的每个点显示标签?
- asp.net – InvalidOperationException:在程序集上找不到“
- asp.net-mvc-3 – Autofac等同于Ninject的WhenInjectedInto
- asp.net – System.Web.UI.ViewStateException,无效的views
- ASP.NET Active Directory成员资格提供程序和SQL配置文件提
- asp.net-mvc – MVC 3 – Razor – 从模型打印值
- .net核心中的ServicePointManager.DefaultConnectionLimit?
- asp.net-mvc – 用于服务应用程序的Microsoft Graph API au
- asp.net-mvc – 从ASP.NET MVC操作返回什么来允许jQuery aj
- asp.net – 为什么在使用双引号的HTML attibute上使用渲染块