Hi,

When using QueryOver (not LINQ) you use the extension method IsLike()

session.QueryOver<Suchwort>()
   .Where(d => !d.IsDeleted && d.IsEnabled && d.Name.IsLike(SuchWort))
   .OrderBy(...

Hope that helps.

Richard

-----Original Message----- From: Witch
Sent: Thursday, March 10, 2011 3:25 PM
To: nhusers
Subject: [nhusers] Re: Unrecognised method call: System.String:Boolean Contains(System.String) - NHibernate 3.0.0 GA

Now I have upgraded to NHibernate 3.1.0 but the Exception persists.

On 10 Mrz., 12:04, Witch <raiko.meinha...@googlemail.com> wrote:
Hi,

I have a problem with the StartsWith/Contains method in a Lambda
expression for a
Where Clause.

var list = session.QueryOver<Suchwort>().Where(d => d.IsDeleted ==
false && d.IsEnabled == true && d.Name.Contains(SuchWort))/*.OrderBy(d
=> d.Anzahl).Desc.Take(10)*/.List();

Once the above expression is called I get the following error message.

Unrecognised method call: System.String:Boolean
Contains(System.String)

The Exception details are below.

"System.Exception" wurde aufgefangen.
  Message=Unrecognised method call: System.String:Boolean
Contains(System.String)
  Source=NHibernate
  StackTrace:
       bei
NHibernate.Impl.ExpressionProcessor.ProcessCustomMethodCall(MethodCallExpre ssion
methodCallExpression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 455.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessBooleanExpression(Expression
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 422.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessExpression(Expression
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 465.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessAndExpression(BinaryExpression
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 359.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessBinaryExpression(BinaryExpressio n
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 378.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessExpression(Expression
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 463.
       bei
NHibernate.Impl.ExpressionProcessor.ProcessLambdaExpression(LambdaExpressio n
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Impl
\ExpressionProcessor.cs:Zeile 470.
       bei NHibernate.Impl.ExpressionProcessor.ProcessExpression[T]
(Expression`1 expression) in d:\CSharp\NH\nhibernate\src\NHibernate
\Impl\ExpressionProcessor.cs:Zeile 481.
       bei NHibernate.Criterion.QueryOver`2.Add(Expression`1
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Criterion
\QueryOver.cs:Zeile 635.
       bei NHibernate.Criterion.QueryOver`2.Where(Expression`1
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Criterion
\QueryOver.cs:Zeile 325.
       bei
NHibernate.Criterion.QueryOver`2.NHibernate.IQueryOver<TRoot,TSubType>.Wher e(Expression`1
expression) in d:\CSharp\NH\nhibernate\src\NHibernate\Criterion
\QueryOver.cs:Zeile 686.
  InnerException:

Since I do not know if this is a bug I ask here first and would be
thankful for any help.

Witch

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhusers@googlegroups.com.
To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.

--
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com.
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to