NHibernate无法将表达式转换为sql语句,因为它不知道如何处理c => c.FirstName +’‘+
c.LastName。解决方案可以将其重写为如下形式:
Session.CreateCriteria<Customer>() .Add(Restrictions.Like( Projections.SqlFunction("concat", NHibernateUtil.String, Projections.Property("FirstName"), Projections.Constant(" "), Projections.Property("LastName")), "Bob Whiley", MatchMode.Anywhere))


