title: I need to be able to cancel a long running NHibernate query that just reads data
body: <p>So I have searched the interwebs and S.O. but I can't seem to find an answer to my problem. I see some places where people can cancel things because they are working with an IQueryable but in my case I have a repository and I am returning a list but I would like to be able to cancel the call to the query which is just returning data - Hmm, I don't know I explained that very well. Hopefully this code snippet should make it more clear. </p>
  
  <pre><code> public class EdiRepository : GenericRepository&lt;EdiEventLog, Guid&gt;, IEdiRepository
  {
      private readonly ISessionStorage _sessionStorage;
      private ISession _session;
  
      public EdiRepository(ISessionStorage sessionStorage)
          : base(sessionStorage)
      {
          _sessionStorage = sessionStorage;
      }
  
      public void Cancel()
      {
          //Uhm, this doesn't seem like the right thing to do. 
          _session.Dispose();
      }
  
      public IList&lt;EdiEventLog&gt; GetAllLogs(List&lt;String&gt; eventTtypes)
      {
          _session = GetSession();
  
          var query = from q in _session.Query&lt;EdiEventLog&gt;()
                      where eventTtypes.Contains(q.EventType)
                      select q;
  
          return query.ToList();
      }
  }
  </code></pre>
  
  <p>If this is redundant and I have just missed it please point me in the right direction but everything I have seen assumes that you are returning and IQueryable not a List.</p>
  
  <p>thanks</p>