0
此查询工作正常DAO领域:城堡的ActiveRecord无法检测某些查询
DetachedCriteria filter = DetachedCriteria
.For(typeof(NotificationRecord), "nr")
.Add(Expression.Eq("nr.Submission.Id", 5));
return ActiveRecordMediator<NotificationRecord>.FindAll(filter);
此查询失败,出现异常消息:could not resolve property: Submission.IsScheduledForNotification of: NotificationRecord
DetachedCriteria filter = DetachedCriteria
.For(typeof(NotificationRecord), "nr")
.Add(Expression.Eq("nr.Submission.IsScheduledForNotification", true));
return ActiveRecordMediator<NotificationRecord>.FindAll(filter);
为了确保ActiveRecord的是认识到IsScheduledForNotification
,我做使用IsScheduledForNotification
作为过滤器的实际Submission
对象的简单查询就像这样,它的工作原理
ActiveRecordMediator<Submission>.Exists(Expression.Eq("IsScheduledForNotification", true));
有人可以说为什么会发生这种情况吗?