Similar to 'Dynamic LINQ OrderBy' I would like to make a dynamic QueryOver-OrderBy. However, when I do this:
query.OrderBy(h => h.GetType().GetProperty(sort.Member).GetValue(h, null)).Asc
I get an exception which says:
Unrecognised method call in epression h.GetType().GetProperty(value(Domain.Model.Repository+<>c__DisplayClass15).sort.Member).GetValue(h, null)
Apparently, nHibernate has some trouble understanding what's going on. Does anyone have an idea on how to solve this particular issue?