NHibernate.Linq and CompareTo String

I use Linq and Hibernate and try to compare one of the variable with the strings and the other with the class associated with Hibernate, the code:

bindingSource.DataSource = (from search in Repository.GetAll() where search.cod_coluna.CompareTo(CurrentRecord.cod_coluna) > 0 orderby search.cod_coluna select search).Take(1); 

And I get an exception in Runtime, QueryException: cannot use subqueries by criteria without projection.

What am I doing now?

+4
source share
1 answer

I think the problem is that CompareTo is not something that can be mapped to SQL.

What type of cod_coluna? You can use == or! = If you really don't need CompareTo.

0
source

All Articles