title: Session.Query returns empty list (nHibernate)
body: <p>Am new to Fluent and Nhibernate so maybe there is a simple issue I am not seeing here. Following is my mapping </p>
  
  <pre><code>public class DriverStatusChangeMapping : ClassMap&lt;DriverStatusChange&gt;
  {
      public DriverStatusChangeMapping()
      {
          Id(x =&gt; x.Id).GeneratedBy.GuidComb();
          Map(x =&gt; x.CreateReceivedAt);
          Map(x =&gt; x.RemoveReceivedAt);
          Map(x =&gt; x.Status);
          Component&lt;AuditAction&gt;(x =&gt; x.Created, m =&gt;
          {
              m.Map(x =&gt; x.ActionByUser).Column("CreatedByUser");
              m.Map(x =&gt; x.ActionByUserType).Column("CreatedByUserType");
              m.Map(x =&gt; x.ActionOccurredAt).Column("CreatedAt");
          });
          Component&lt;AuditAction&gt;(x =&gt; x.Removed, m =&gt;
          {
              m.Map(x =&gt; x.ActionByUser).Column("RemovedByUser");
              m.Map(x =&gt; x.ActionByUserType).Column("RemovedByUserType");
              m.Map(x =&gt; x.ActionOccurredAt).Column("RemovedAt");
          });
  
          References(c =&gt; c.DriverLogEntry)
              .Column("DriverLogEntryID")
              .Access.Property()
              .Cascade.All();
  
          Table("tblDriverStatusChange");
  
      }
  }
  </code></pre>
  
  <p>Am using In memory testing to verify the repository returns the proper data. My RespositoryTestBase is as follows.</p>
  
  <pre><code>public class RepositoryTestBase : IDisposable
  {
      private static NHConfiguration.Configuration _configuration;
      private static ISessionFactory _sessionFactory;
  
      protected ISession Session { get; set; }
  
      public RepositoryTestBase()
      {
          _sessionFactory = CreateSessionFactory();
          Session = _sessionFactory.OpenSession();
          BuildSchema(Session);
      }
  
      private static ISessionFactory CreateSessionFactory()
      {
          return Fluently.Configure()
            .Database(SQLiteConfiguration.Standard.InMemory().ShowSql())
            .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;Driver&gt;())
            .ExposeConfiguration(cfg =&gt; _configuration = cfg)
            .BuildSessionFactory();
  
      }
  
      public void BuildSchema(ISession session)
      {
          var export = new SchemaExport(_configuration);
          export.Execute(true, true, false, Session.Connection, null);
      }
  
  
  
      public void Dispose()
      {
          Session.Dispose();
      }
  }
  </code></pre>
  
  <p>Now when I perform a get on the session as such ....I have DriverStatusChange records </p>
  
  <pre><code>_session.Get&lt;DriverStatusChange&gt;(new Guid("6c9b5d4d-986d-4ff7-86ae-a05300d34a8b")); 
  </code></pre>
  
  <p>BUT a simple Query as follows always returns an empty list.</p>
  
  <pre><code>_session.Query&lt;DriverStatusChange&gt;().Select(d =&gt; d).ToList();
  </code></pre>
  
  <p>Following is my test class that uses the RepositoryTestBase</p>
  
  <pre><code>public class DriverStatusChangeRepositoryTests:RepositoryTestBase
  {
      private IDriverStatusChangeRepository _driverStatusChangeRepository;
  
  
      [SetUp]
      public void Init()
      {
  
          var mockLogger = new Mock&lt;ILogger&gt;();
          _driverStatusChangeRepository = new DriverStatusChangeRepository(Session, mockLogger.Object);
  
  
      }
  
  
      [TearDown]
      public void TearDown()
      {
          Session.Clear();
      }
  
      [TestFixtureTearDown]
      public void TestFixtureTearDown()
      {
          Dispose();
      }
  
  
      [Test]
      public void get_where_removed_at_is_null()
      {
        var driverStatusChanges = CreateDriverStatusChanges(4);
                 var removedDriverStatusChange = driverStatusChanges[1];
                  removedDriverStatusChange.Removed = new AuditAction()
                                                  {
                                                      ActionByUser = "John Doe",
                                                      ActionByUserType = "User Type",
                                                      ActionOccurredAt = DateTime.UtcNow
                                                  };
                  removedDriverStatusChange.RemoveReceivedAt = DateTime.UtcNow;
                  _driverStatusChangeRepository.Update(removedDriverStatusChange);
  
                  var actual = _driverStatusChangeRepository.GetCurrent(10001, DateTime.MinValue, DateTime.UtcNow).Count;
                  Assert.AreEqual(3,actual, "Get current did not match");
  
  
  
  
      }
  
  
      private List&lt;DriverStatusChange&gt; CreateDriverStatusChanges(int number)
      {
  
          var driverStatusChanges = new List&lt;DriverStatusChange&gt;();
          for (int i = 0; i &lt; number; i++)
          {
              var driverStatusChange = new DriverStatusChange()
              {
                  Created = GetCreated(i),
                  CreateReceivedAt = DateTime.UtcNow,
                  DriverLogEntry = new DriverLogEntry() {CreateReceivedAt = DateTime.UtcNow, Id = Guid.NewGuid(), Driver = new Driver() { DriverID = i+10000}},
                  Removed = null,
                  RemoveReceivedAt = null
              };
              _driverStatusChangeRepository.Add(driverStatusChange);
              driverStatusChanges.Add(driverStatusChange);
  
          }
          return driverStatusChanges;
      }
  
      private AuditAction GetCreated(int number)
      {
          return
              new AuditAction()
                  {
                      ActionByUser = "Jane Doe" + number.ToString(CultureInfo.InvariantCulture),
                      ActionByUserType = "User Type",
                      ActionOccurredAt = DateTime.UtcNow
                  };
  
      }
  
  
  
  
  }
  </code></pre>