I'm trying to restrict my NHibernate query with some basic date/time manipulation. More specifically, I want to execute the following statement (pseudo-SQL):
select * from article where created_on + lifespan >= sysdate
with:
created_onis mapped to a property of typeDateTime.lifespanis mapped to a property of typeTimeSpan.sysdateis the current date/time (of the database server or ofthe application host, I don't care)
Is there any built-in way to do that by using the Criteria-API or HQL?
return session
.CreateCriteria<Article>()
.Add( ? )
.List<Article>();