SubSonic 3.0.0.4 中没有找到WhereExpression 方法?
这是我第一次在任何论坛上发帖,所以请原谅我的礼仪。
我使用 SubSonic 3.0.0.4 并尝试使用 ActiveRecord 连接流畅查询,我希望能够使用 SqlQuery 的WhereExpression 方法开始添加带有圆括号的“OR”语句列表,以将该列表从其他约束中排除例如,
var qry =
db.Select.From<DocumentHeader>();
qry.WhereExpression(DocumentHeadersTable.InvoiceNoColumn).Like(myList.Items[0]);
for (Int32 i = 1, n = myList.Items.Count; i < n; i++) {
qry.Or(DocumentHeadersTable.InvoiceNoColumn).Like(myList.Items[i]);
}
qry.CloseExpression();
还有更多内容,但这是一个粗略的例子。在网上搜索并查看 SubSonic 的 Fluent Query 页面,发现WhereExpression 方法确实存在,但是查看 Intellisense,然后在从 GitHub 下载的源代码中,我只能找到一个 Property 而不是 Method。我已经设法解决上述问题,但WhereExpression 会很有用。
所以我的问题是,这个方法被删除了吗?或者它的用法改变了?或者很可能我很愚蠢并且找错了地方?
提前致谢。 李
This is my first ever post on any forum, so excuse my etiquette.
Im using SubSonic 3.0.0.4 and was trying to concat a Fluent Query using ActiveRecord, I want to be able to use the WhereExpression method of SqlQuery to start adding a list of 'OR' statements with brackets round, to exclude the list from other constraints E.g.
var qry =
db.Select.From<DocumentHeader>();
qry.WhereExpression(DocumentHeadersTable.InvoiceNoColumn).Like(myList.Items[0]);
for (Int32 i = 1, n = myList.Items.Count; i < n; i++) {
qry.Or(DocumentHeadersTable.InvoiceNoColumn).Like(myList.Items[i]);
}
qry.CloseExpression();
There is more to it than this but this is a rough example. Searching on the web and looking at the Fluent Query page of SubSonic it suggests that the method WhereExpression does exist, but looking at the Intellisense and then in the source code downloaded from the GitHub, I could only find a Property not a Method. I have managed to do a workaround for the above problem, but the WhereExpression would be useful.
So after all that my question is, has this method been removed? or its usage changed? Or most likely Im being stupid and looking in the wrong place?
Thanks in advance.
Lee
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,由于 3.0 版本中大量添加了 LINQ 支持,WhereExpression 得到了另一种实现,因此只需使用
Where
方法即可。Apparently, the WhereExpression got another implementation due to a massive addition of LINQ support in the version 3.0, so just use the
Where
method instead.