Well, you can't actually sort using a stored procedure, not even in fullblown TSQL, but you can use a UDF. There are a couple of ways (quite intricate) to get that included in a query, so if it's OK with you I'd recommend adding the ordering value as a property on CartItem, set it as a Formula (with the UDF as the definition) and Lazy. That way, you should be able to order by it.
/G 2013/8/25 Gleb Chermennov <[email protected]> > I know this sound like a question from a newcomer - and that's probably > because it is. > Is there any way to use a sql function in an orderby clause in NHibernate? > Let's say I want to order a query result set by result of some built-in SQL > function or my stored procedure? Something like following: > var items = session.QueryOver<CartItem>(c => c.Price > 200).OrderBy("exec > dbo.MyCustomLogic").ToList(); > > -- > 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/groups/opt_out. > -- 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/groups/opt_out.
