Suppose the following Query using a NH 3.4 and RepositoryPattern
var list = _repository
.QueryOver()
.Where(x => (x.Age > 20)) // notice the parantheses
.Future()
.ToList();
Whith these parantheses added the NH is failing to work, and causes a SO exception.
If replacing .Where(x => (x.Age > 20))
with .Where(x => x.Age > 20)
it works as expected.
Any clues on why it doesn't work with extra parantheses?
Note
This is a simplified scenario from the bigger picture. In production i'm passing that .Where(...)
through a parameter Expression<Func<Person, bool>> where
I have a doubt the error is there:
The brackets are removed by the compiler. There is nothing in the Expression tree "language" (class system) to explicitly represent a bracket.