在Nhibernate 3.2中创建Linq表达式时,有没有办法将sysdate作为生成的sql的一部分传递?
例如,像这样
from c in _session.Query<Question>
where Question.EDate.Date = sysdate
或
from c in _session.Query<Question>
where Question.Edate.Date == trunc(sysdate)
生成一个select语句,如:
select * from question where trunc(EDate) == trunc(sysdate)
答案 0 :(得分:0)
仅通过扩展LINQ提供程序(并非那么困难):
http://fabiomaulo.blogspot.pt/2010/07/nhibernate-linq-provider-extension.html http://www.primordialcode.com/blog/post/nhibernate-3-extending-linq-provider-fix-notsupportedexception