在 Nhibernate 3.2 上,我遇到了 Linq 查询问题:
var temp = Session.Query<RequestForQuotation>().OrderByDescending(o => o.DateIssued).ToList();
var temp2 = Session.Query<RequestForQuotation>().OrderByDescending(o => o.DateIssued).SelectMany(o => o.RequestForQuotationItems).ToList();
var temp3 = Session.Query<RequestForQuotation>().OrderByDescending(o => o.DateIssued).SelectMany(o => o.RequestForQuotationItems).Select(o => o.SupplierProduct).ToList();
temp3 抛出异常
NHibernate.QueryException:无法解析属性:DateIssued of:XXXX.Domain.Entities.RequestForQuotationItem
显然 DateIssued 是 RequestForQuotation 的属性/列而不是 RequestForQuotationItem
这是 Nhibernate Query 的一个已知问题还是我的想法有问题?有解决方法吗?