I found the solution, but I don't know how to translate those solution (in NHibernate) to ActiveRecord.
Get current database server date using Castle ActiveRecord
493 views Asked by Khairuddin Ni'am At
2
There are 2 answers
0
On
Just for the record, Castle ActiveRecord does support HQL and SQL named queries (with [HqlNamedQuery]
and [SqlNamedQuery]
respectively), see this article. For this particular case, I agree with Mike, just use a simple SQL query.
Instead of using a named queries (which I'm not even sure if Castle supports) you could create a native query which is essentially the same thing IMO.
Replace
Helper.GetSession()
with whatever function or property you use to fetch the Castle AR session.