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 believe this is what you are looking for:
var theaters = from theater in Session.Linq()
where theater.Name.Contains("test")
select theater;
According to my tests it generates an SQL 'LIKE' statement: "... WHERE theater.Name LIKE %test%"
which is exactly the output of the criteria snippet you have provided.