How can I produce this query using NHibernate.Linq?
WHERE this_.Name LIKE @p0; @p0 = \'test\' // Notice NO % wild card
Note, this is not Linq
I had the same problem in my project and found a solution :
session.Linq() .Where(x => x.Name.StartsWith("test") && x.Name.EndsWith("test");
This translates in SQL to
SELECT ... WHERE Name LIKE '%test' AND Name LIKE 'test%'