Created
April 19, 2012 09:42
-
-
Save jmcd/2419991 to your computer and use it in GitHub Desktop.
QueryOver select except
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scheduleDateAlias = default(ScheduleDate); | |
return session.QueryOver(() => scheduleDateAlias) | |
.WithSubquery.WhereNotExists( | |
QueryOver.Of<CommunityGrantApplicationChequeRequest>() | |
.Where(x => x.ScheduleDate.Id == scheduleDateAlias.Id) | |
.Select(x => x.ScheduleDate) | |
) | |
.OrderBy(scheduleDate => scheduleDate.Rank).Asc | |
.List<ScheduleDate>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The trick is to define the alias in the parent query, then reference it in the subquery.