-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NHibernate.Linq.dll with VB.NET
PostPosted: Mon May 18, 2009 7:25 am 
Newbie

Joined: Mon May 18, 2009 7:10 am
Posts: 2
I'm playing around with the NHibernate.Linq.dll and I'm having problems using it in combination with VB.NET.

I've started out with a very easy query:
Code:
From myBO In session.Linq(Of myBusinessObject)() _
Where myBO.myProperty = "test" _
Select myBO


The query throws the following error when I ask for the results:
"Expression of type 'System.Int32' cannot be used for return type 'System.Boolean'"

A very weird error so I tried the same query in a C# project:
Code:
from myBO in session.Linq<myBusinessObject>()
where myBO.myProperty == "test"
select myBO;


When I ask the results from the C# query it works perfectly. Before getting to deep into the NHibernate.Linq.dll code I would like to get confirmation if there are many known issues with the Linq for NHibernate dll in combination with VB.NET? Because when I look at the error I suspect a problem with the dll building the lambda expression and/or expression tree with the VB.NET language...


Top
 Profile  
 
 Post subject: Re: NHibernate.Linq.dll with VB.NET
PostPosted: Thu Jun 11, 2009 9:38 am 
Newbie

Joined: Thu Jun 11, 2009 9:36 am
Posts: 1
I'm running into the same issue. Did you manage to get it resolved?


Top
 Profile  
 
 Post subject: Re: NHibernate.Linq.dll with VB.NET
PostPosted: Thu Jun 11, 2009 9:44 am 
Newbie

Joined: Mon May 18, 2009 7:10 am
Posts: 2
Nope, resolved it by using myBO.myProperty.Equals("test") for simple string comparison.

More complex statements can be written by their lambda expressions and predicates and such. It works that way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.