In the crit.Add expressions below e.EventDate is doing what is expected and limiting the dates of my query correctly, but when I use the same reference in crit.AddOrder it cannot resolve that property
"could not resolve property:EventDate"
crit.CreateAlias("Event", "e");
crit.Add(Expression.Gt("e.EventDate", dtStartDate));
crit.Add(Expression.Lt("e.EventDate", dtEndDate));
NHibernate.Expression.Order ord = new Order("e.EventDate", true);
crit.AddOrder(ord);
In the NHibernate log file I'm getting this:
18:17:35.808 [2196] INFO NHibernate.Persister.GetSetHelperFactory - Disabling reflection optimizer for class eventApprovalHibernateLib.Event
18:17:35.808 [2196] DEBUG NHibernate.Persister.GetSetHelperFactory - CodeDOM compilation failed
System.NullReferenceException: Object reference not set to an instance of an object.
at NHibernate.Persister.GetSetHelperFactory.GenerateCode()
at NHibernate.Persister.GetSetHelperFactory.CreateGetSetHelper()
I'm using NHibernate version - v1.1.4322
This seems very strange to me. I must be missing something.
|