You can use QueryOver and Projections.Conditional(creiterion, return if 
true, else)


On Wednesday, July 16, 2014 3:22:00 AM UTC+7, [email protected] wrote:
>
> I need to use NHibernate's LINQ QueryOver() syntax to perform the 
> following logic:
>
> select * 
> from dealerManufacturer dm
> join manufacturers m on m.manuid=dm.manufacturerId
> order by
>       case m.name when 'Lexus' then 0
>       else 1
>       end
>
>
> Do I need to use Projections? I am not sure how to code this.
>
> Please give me a hand if you know.
>
> The following does not work:
>
>             return base.QueryOver(query).
>                 Where(x => x.DealerId == DealerId).
>                 OrderBy(x => (x.Manufacturer == "Lexus" ? 0 : 1)).Asc();
>
> But shows the the essence of what I need.
>
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to