title: Map collection as Queryable
body: <p>I've grown accustomed in SQLAlchemy (Python) to map a relationship/collection with <code>lazy="dynamic"</code> which maps the property as a Query object instead of a populated list/collection (or Proxy for lazy loaded properties).  This mapped property then allows you to further refine the query used to fetch the collection before doing so (apply an order, limit, filter, etc).</p>
  
  <p>For example, in SQLAlchemy I can map a relationship like so:</p>
  
  <pre><code>class Post(Base):
      ...
  
  class User(Base):
      ...
      posts = relationship(Post, lazy="dynamic")
  </code></pre>
  
  <p>And then when I retrieve a user, I can apply an order on posts, or only retrieve the last 5, etc.</p>
  
  <pre><code>user = session.query(User).get(1)
  
  # Fetch the last 5 posts by user 1
  posts = user.posts.order_by(Post.create_date.desc()).limit(5).all()
  </code></pre>
  
  <p><a href="http://docs.sqlalchemy.org/en/rel_0_7/orm/collections.html" rel="nofollow">http://docs.sqlalchemy.org/en/rel_0_7/orm/collections.html</a></p>
  
  <hr>
  
  <p>I would love to find a way to do this using Fluent NHibernate, mapping the collection as a QueryOver or IQueryable (LINQ) such as:</p>
  
  <pre><code>public virtual QueryOver&lt;Post&gt; Posts {get; set;}
  or
  public virtual IQueryable&lt;Post&gt; Posts { get; set; }
  </code></pre>
  
  <p>and in the mappings do something like:</p>
  
  <pre><code>public class UserMap : ClassMap&lt;User&gt;
  {
      public UserMap()
      {
          ...
          HasMany(u =&gt; u.Posts).Fetch.Dynamic
      }
  }
  </code></pre>
  
  <p>Is this currently possible using Fluent NHibernate (or just NHibernate)?</p>