是withParameters在微风实体查询仍然支持? [英] Is withParameters still supported in Breeze entity query?

查看:132
本文介绍了是withParameters在微风实体查询仍然支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 withParameters 方法对这样的查询:

  query.withParameters({includeLocation:真})

不幸的是我的参数没有被添加到URL。我用breeze.debug.js我发现它此行

  // queryOptions = __extend(queryOptions,this.parameters);

那是一个错误吗?取出 withParameters 支持?还是我做错了什么?

我使用的OData

解决方案

.withParameters 时,这些参数将被添加到数据服务适配器的URL,而不是微风核心。这就是为什么该行被注释掉。这允许参数要连接$ C $光盘不同,这取决于所使用的后端

这是伟大的,但数据服务适配器的OData附带微风1.4.8不处理 .withParameters 。该适配器的WebAPI做,但不是OData的适配器。我们将确保它在未来的版本中加入。在此期间,您可以继续使用您的解决方法。

这个监督/遗漏部分是因为我们不知道,处理自定义参数的任何OData的服务。如果我可能会问,什么是您使用的OData服务?

I tried to use withParameters method on query like that:

query.withParameters({ includeLocation: true })

Unfortunately my parameter was not added to url. I use breeze.debug.js and I've found this line in it

//queryOptions = __extend(queryOptions, this.parameters);

Is that a bug ? Is withParameters support taken out ? Or do I do something wrong ?

I use oData

解决方案

When .withParameters is used, the parameters are added to the URL by the data service adapter, not by the Breeze core. That's why that line is commented out. This allows the parameters to be encoded differently, depending upon the backend that is used.

That's great, but the data service adapter for OData that ships with Breeze 1.4.8 does not handle .withParameters. The WebApi adapter does, but not the OData adapter. We'll make sure it's added in a future release. In the meantime, you can continue to use your workaround.

This oversight/omission is partly because we don't know any OData services that handle custom parameters. If I may ask, what OData service are you using?

这篇关于是withParameters在微风实体查询仍然支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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