nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

QueryOver throw Could not determine member type from Constant

Open pasqualedante opened this issue 4 years ago • 1 comments

if I execute this statement the exception stated in subject is throw: var jk = session.QueryOver<T>().Where(x => 1 == 1).Take(1);

if I execute this statement via ::Query and not via ::QueryOver all works fine:
var jk = session.Query<T>().Where(x => 1 == 1).Take(1);

This differtent behavior is by design?

Thanks in advance.

pasqualedante avatar Jun 01 '21 15:06 pasqualedante

I don't think it's by design - simply not implemented. My guess it would work parametrized:

var v = 1;
var jk = session.QueryOver<T>().Where(x => v == 1).Take(1);

bahusoid avatar Jun 01 '21 16:06 bahusoid