public IListGetAll () { return Session.GetSession() .CreateCriteria(typeof(T)) .List (); }
Because NHibernate uses generics, this function can act as a pass-through, requesting the List method be run, but not much more. My ASP .NET webforms application has to give it the table name of interest.
Again, just a fun way to rapidly get a "table viewer" application running but also providing some code value for potential full life cycle development later.
* Re-reading years later, I think I meant
GetAll(T)as the Type would have to be passed to the function.