SubSonic.Query vs SubSonic.SqlQuery

喜你入骨 提交于 2019-12-11 08:33:59

问题


I've been using SubSonic.Query all these while, until one day when I can't do "IS NULL" by adding WHERE, then I realized that SubSonic.SqlQuery existed and it has a function of "IsNull()". After checking out the source code, Query and SqlQuery is not inherited in any way, so what's their major difference and how to decide which to use?

Edit: I just realized that I could actually do "IS NULL" by using "Comparison.Is". That makes me even more confuse as both SqlQuery and Query can almost do the same thing


回答1:


SqlQuery was added in version 2.1. It's vastly superior to Query as it supports is null and joins in particular. Here's a post that covers it (it was called Query2 at the time) or see my 3-part series on how I use SubSonic.




回答2:


I am not sure what DB you are targeting but the IsNull Method did not work correctly for the Oracle Provider. I had to fix change a couple lines to get it to work on my machine.



来源:https://stackoverflow.com/questions/627719/subsonic-query-vs-subsonic-sqlquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!