Selecting from Linq to Sql, I want to have a string search using wildcards. So far I understand it is possible to do the following
%token = column.EndsWith(value)
token% = column.StartsWith(value)
%token% = column.Contains(value)
What I can't seem to find support for is
to%ken
Is that supported in any way?
Update - people have suggested SqlMethods.Like - however this doesn't seem to work in the usage I have, code below
if (!object.Children.Any() ||
!object.Children.OrderByDescending(t => t.Version)
.First().MetaDataPairs.Any(mdp => SqlMethods.Like(mdp.Value.ToLower(), stringmatch))) continue;
and error I get when trying this
Error was Method 'Boolean Like(System.String, System.String)' cannot be used on the client; it is only for translation to SQL.