Ok, so I have an nHibernate ICriteria that returns an object. I want to order by a single property but NOT asc or desc I want certain values of the property to come to the top of the repeater based on the selection. Like if I choose "video" I want all records with videos to come to the top.
Now, can I do this in the query? or the repeater? ICriteria?
Thanks for your help.
Well...if you can't figure out how to do it with NHibernate, you could always use linq-to-objects, then bind your repeater to that:
var bubbleVideos = from item in criteriaList
orderby (item.ItemType == "video" ? 0 : 1)
select item;
repeater.DataSource = bubbleVideos.ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With