title: Write subquery in Criteria of nHibernate
body: <p>I've read about subquery in Criteria, but I am still unable to grasp it properly. Here I am taking one example and if somebody can help me write that using subquery it will be great.</p>
  
  <p>Lets say we have table </p>
  
  <pre><code>Employee{EmployeeId.(int),Name(string),Post(string),No_Of_years_working(int)}
  </code></pre>
  
  <p>Now I want all the employees who are Managers and working for less than 10 years. I know that we can get the result without using subqueries but I want to use subquery just to understand how it works in criteria. </p>
  
  <p>So, how I can write Criteria using subquery to get those employees.</p>