我想知道以下SQL查询的标准:
SELECT * FROM PageDetails WHERE PageRoom_Id = 4 Order By SentDate DESC, Id DESC
目前我使用的标准如下:
var criteria = unitOfWork.CurrentSession.CreateCriteria(typeof(PageDetails))
.CreateAlias("PageRoom", "pageRoom")
.Add(Restrictions.Eq("pageRoom.PageRoom_Id", pageRoom.PageRoom_Id))
.AddOrder(Order.Desc("SentDate"));
如何再添加一个订单?
答案 0 :(得分:0)
试试这个:
var criteria = unitOfWork.CurrentSession.CreateCriteria(typeof(PageDetails))
.CreateAlias("PageDetails", "pageDetails")
.Add(Restrictions.Eq("pageDetails.PageRoom_Id", pageRoom.PageRoom_Id))
.AddOrder(Order.Desc("SentDate"))
.AddOrder(Order.Desc("Id"));