Out of curiosity is it possible to do something like this using NHibernate 3?
public IQueryable<T> FindAll<T>()
{
return Session.QueryOver<T>().List().AsQueryable();
}
I get a compilation error saying something like...
The Type T must be a reference type in order to use it as a parameter T.
I was wondering if I could create an extension method to Session.QueryOver to handle a generic type.
I could replace this using something like
return Session.CreateCriteria(typeof (T)).List<T>().AsQueryable();
But was keen to use the features of the query api. Any ideas? maybe missing something obvious!!