views:

17

answers:

1

The Foo column is defined as "Foo TEXT unique". Will an Eq().IgnoreCase() query use the index or will it perform a complete column scan?

The query:

string foo = "foo";
IList<T> list = session.CreateCriteria(typeof(T)).
    Add(Expression.Eq("Foo", foo).IgnoreCase()).List<T>();
+1  A: 

No. What IgnoreCase does is convert the property and parameter to lower case.

Diego Mijelshon