Nhibernate
Posted: Wed Apr 10, 2013 12:03 am
I have two questions related to Nhibernate.
1. how to pass sortexpression to Nhibernate criteria . For instance ,I want to sort by product.createddate desc.
what value I should give to sortExpression. CreatedDate.Desc?
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
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