开发者

Trouble when trying to use Nhibernate.Linq

开发者 https://www.devze.com 2023-01-04 11:17 出处:网络
I have been trying to implement Nhibernate.Linq 1.0.0.4000 together with Nhibernate 2.1.2.4000. After what I\'ve read that should be a straightforward process - just adding a reference to Nhibernate.L

I have been trying to implement Nhibernate.Linq 1.0.0.4000 together with Nhibernate 2.1.2.4000. After what I've read that should be a straightforward process - just adding a reference to Nhibernate.Linq and then start querying with Session.Linq<>..

So.. In my repository I added a very simple query:

  var query = (from l in _session.Linq<User>()  select l);
  return query.ToList();

However I run into an error I just can't understand. The error message is:

{"Entry point was not found.":""}

at NHibernate.ISession.get_SessionFactory() at NHibernate.Linq.NHibernateQ开发者_JAVA技巧ueryProvider.TranslateExpression(Expression expression) at NHibernate.Linq.NHibernateQueryProvider.Execute(Expression expression) at NHibernate.Linq.Query1.GetEnumerator() at System.Linq.SystemCore_EnumerableDebugView1.get_Items()

Initially I thought It could be related to me configuring and mapping with Fluentnhibernate, but after reverting to vanilla config and mapping, I still have the same problem.

Should I switch the above linq-query to the ICriteria equivalent, it works like a charm.

Has this happened to anyone else? Do you have a solution?

TIA //Marcus


I believe you are using the wrong build of NHibernate.Linq.

This is the one you should download.

0

精彩评论

暂无评论...
验证码 换一张
取 消