I believe I have found a bug when ordering by a property of a property.
I am not sure where to post bugs so I will do it here until I get directed to otherwise.
I have one class with a relationship to another enitity. Retrieving a list of objects works fine. But when I sort by a property of the related class I get weird results. The query fails to return objects where the related entity is null.
here is the query:
Code:
from JobPost as post where post.Department = ? order by post.StaffMember.LastName ASC
here is the resulting sql from the query:
Code:
select top 10 jobpost0_.jobpostid as jobpostid, jobpost0_.memberid as memberid, jobpost0_.departmentid as departme4_ from jobpost jobpost0_, member member1_ where jobpost0_.memberid=member1_.memberid and ((jobpost0_.departmentid=@p0)) order by member1_.LastName ASC', N'@p0 int', @p0 = 1
The code creating the query has wrongfuly added this
jobpost0_.memberid=member1_.memberid. The member can be null so incorrect results are produced. I believe a join should be created in this instance.
Let me know if I should post this somewhere else or if you need any more info.