Converting Hibernate linq query to HQL

为君一笑 提交于 2019-12-06 08:46:16

I think I've seen ADO.NET Data Services as advertised to work with NHibernate:

http://wildermuth.com/2008/07/20/Silverlight_2_NHibernate_LINQ_==_Sweet

http://ayende.com/Blog/archive/2008/07/21/ADO.Net-Data-Services-with-NHibernate.aspx

This is an old post, and not sure how maintained this feature is, but its worth a shot.

I have a suggestion to you. Do not try to serialize query. Rather provide your user with an ability to compose arbitrary LINQ expression. Then send the expression over the wire (there is a gotcha here, since expressions are not serializable) to your server.

I have recently submitted to NHibernate.Linq project a change to their NHibernateExtensions class - a new ISession extension method List, which accepts an expression and fills the given list with the respective data, much like ICriteria.List method. The change was accepted (see here) so downloading the recent version of NHibernate.Linq should contain this method.

Anyway, you can find the details of this approach here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!