1. how to pass sortexpression to Nhibernate criteria . For instance ,I want to sort by product.createddate desc.
Code: Select all
ICriteria criteria = NHibernateHelper.CreateCriteria<Product>(maximumRows, startRowIndex, sortExpression);
criteria.Add(Restrictions.Eq("VisibilityId", (byte)CatalogVisibility.Public));
2. I want to get the lastest created time from product table and assign that to a variable. How can I do that with Nhibernate?
Thanks