1

我想知道以下 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"));

如何添加更多订单?

4

1 回答 1

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"));
于 2013-10-16T10:00:44.663 回答