Linq for string comparison

I have a linq question for nhibernate. I need to create a query in which I could use string comparison:

session.Linq<User>()
       .Where(u => String.Compare(u.Name, givenName) < 0)
       .ToList()

Do I understand correctly that this is not supported in linq-to-nhibernate? Is there a way to use string comparison in linq-to-nhibernate?

+3
source share
2 answers

The new integrated provider in NHibernate 3 allows you to expand it to support almost any design you want.

Check http://fabiomaulo.blogspot.com/2010/07/nhibernate-linq-provider-extension.html for a complete example.

Of course, you need to think about a reasonable HQL representation of this expression.

+2
source

This is no longer needed. Now lambda expression in question is supported.

0
source

Source: https://habr.com/ru/post/1776127/


All Articles