title: Fluent NHibernate list<T> inside class
body: <p>I am trying to get a <code>List&lt;User&gt;</code> which in turn contains a <code>List&lt;Article&gt;</code> for every <code>User</code>, however when querying i get the <code>List&lt;User&gt;</code> and every <code>User</code> (the only <code>User</code>) has a <code>List&lt;Article&gt;</code> but it doesn't contain anything.</p>
  
  <p>I've checked my DB and the keys match, so my guess (well ,not much of a guess) is that there is some issue in my mapping. I've searched for examples for one-to-many (HasMany) and tried them but nothing's working. Anyone who have any idea what might be wrong? </p>
  
  <p>Classes</p>
  
  <pre><code>    public class User
      {
          public virtual int UserId { get; set; }
          public virtual string Name { get; set; }
          public virtual string Password { get; set; }
          public virtual IList&lt;Article&gt; Articles { get; set; }
  
          public User()
          {
              Articles = new List&lt;Article&gt;();
          }
      }
  
  public class Article
  {
      public virtual int ArticleId { get; set; }
      public virtual string Title { get; set; }
      public virtual string Ingress { get; set; }
      public virtual DateTime Created { get; set; }
      public virtual string ArticleText { get; set; }
      public virtual User Author { get; set; }
  }
  </code></pre>
  
  <p>These are my mappings</p>
  
  <pre><code>    public class UserMap : ClassMap&lt;User&gt;
      {
          public UserMap()
          {
              Id(x =&gt; x.UserId);
              Map(x =&gt; x.Name);
              Map(x =&gt; x.Password);
              HasMany(x =&gt; x.Articles).KeyColumn("UserId").LazyLoad();
          }
      }
  
  
      public class ArticleMap : ClassMap&lt;Article&gt;
      {
          public ArticleMap()
          {
              Id(x =&gt; x.ArticleId);
              Map(x =&gt; x.Title);
              Map(x =&gt; x.Ingress);
              Map(x =&gt; x.Created);
              References(x =&gt; x.Author).Column("UserId").LazyLoad();
              Map(x =&gt; x.ArticleText).Length(4001);
          }
      }
  </code></pre>
  
  <p>And here is my call to insert / select</p>
  
  <pre><code>        List&lt;User&gt; usr = new List&lt;User&gt;();
          using (var session = SessionFactoryHelper.OpenSession())
          {
              using (var transaction = session.BeginTransaction())
              {
  
  
  
                 User u = new User
                 {
                     Name = "Mohindra",
                     Password = "Corn"
                 };
  
                 Article a = new Article
                 {
                     Title = "Doh!",
                     Ingress = "yada yada",
                     ArticleText = "why dammit! whyyy?!11!!",
                     Created = DateTime.Now,
                     Author = u
                 };
  
                 session.Save(u);
                 session.Save(a);
  
  
                 usr = session.Query&lt;User&gt;().ToList();
                 transaction.Begin();
  
                 transaction.Commit();
              }
          }
  </code></pre>
  
  <p>This might be the simplest of rookie mistakes but I am very new to using O/RM's so i don't know what might be the issue here.</p>
  
  <p><img src="https://i.stack.imgur.com/BCluj.png" alt="Image"></p>