I'm testing out nhibernate 3 CR, but fails to create the following SQL using Linq:
select *
from Users as {user}
inner join Test as test on test.UserId = user.Id
inner join Release as release on release.TestId = test.TestId
where Release.Status = 1
order by count(release.Status) desc;
I have not got so far, my current code is like this and gives me something complete different:
var users = from user in Session.Query<User>()
join test in Session.Query<Test>() on user.Id equals test.User.Id
join release in Session.Query<Release>() on test.Id equals release.Test.Id
where release.Status == 1
orderby release.Status
descending
select user;
Is there any resources on how to use inner joins with linq? And what should I do with:
order by count(release.Status)
Is this something that should be done with QueryOver instead?