I am trying to write QueryOver statement for selecting N rows in the descending time order.
session.QueryOver<T>().Take(10).OrderBy(x=>x.DateInserted);
Unfortunately this is not at all working.
Is there any way to sort it out?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You haven’t specified if you want ascending or descending order in your query, so try doing like this:
At the end you have to call List to get a collection containing the results, and don’t forget to replace the generic type T by your class name.