what is the problem/exception with that code?
2010/5/3 Azhar <[email protected]> > can anyone help me to create a paginated list with filter and sort > criteria using CreateMultiCriteria, > > my code is as follows > > public IList<T> GetPagedData(int page, int pageSize, out long count) > { > try > { > IList<T> all = new List<T>(); > > ISession s = NHibernateSession; > IList results = > s.CreateMultiCriteria() > > .Add(s.CreateCriteria(typeof(T)).SetFirstResult(page).SetMaxResults(pageSize)) > > .Add(s.CreateCriteria(typeof(T)).SetProjection(Projections.RowCount())) > .List(); > > foreach (Object o in (IList)results[0]) > all.Add((T)o); > > count = long.Parse((((IList)results[1]) > [0]).ToString()); > return all; > } > catch (Exception ex) { throw new > Exception("GetPagedData", ex); } > } > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
