Hi, I have a problem using QBE with NHibernate.
Here's a sample code:
Person person = new Person();
person.FirstName = "e";
using (ISession session = SessionFactory.CreateSession())
{
Example example = Example.Create(person).ExcludeProperty("DateOfBirth").EnableLike().IgnoreCase();
IList<Person> people = session.CreateCriteria<Person>().Add(example).List<Person>();
return people;
}
What I expect is that this example & criteria will return all persons whose first name starts with an "e". BUT, to accomplish this I had to insert escape character in the example object's property. Like this:
person.FirstName = "e%";
With this modification, query returns the desired results. Shouldn't the "EnableLike" take care of this?
What am I doing wrong?
Thanks!