Nhibernate: using Expression

Posted by VoodooChild on Stack Overflow See other posts from Stack Overflow or by VoodooChild
Published on 2010-05-17T17:45:02Z Indexed on 2010/05/17 17:50 UTC
Read the original article Hit count: 166

Filed under:
|

Hello,

Using nHibernate, I would like to query on an integer datatype, but its always returning the exact match.

How could I write an expression that returns a list starting with the number entered?

right now I am using it as: (clientNum is a long)

crit.Add(Expression.Like("ClientNumber", clientNum)); //this always gives me exact matches only

so I tried the following, but its complainging of a wroing type (its only expecting a string)

crit.Add(Expression.Like("ClientNumber", clientNum, MatchMode.Start));

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about query