I need to return records filtered and sorted by complex logic. I am planing to make sorting and filtering at the database side (function or stored procedure).
Is it possible to call procedure or function at the QueryOver or Criteria syntax in order to make filtering of the query?
Something like code shown below, where CallProcedure - calling my procedure/function
var articles = Session.QueryOver<ArticleData>()
.Where(x => x.CompanyId == 1)
.CallProcedure???
.Skip(startIndex)
.Take(number).List();
Thanks for help.