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));
有人可以說爲什麼會發生這種情況嗎?