Search code examples
c#linqlambda

Like in Lambda Expression and LINQ


How can I do something like this using Expression trees :

customers.Where(c => c.Name **like** "john");

I know this isn't possible but I was wondering how can I have something similar.

Note : I'm NOT looking for solutions using SQL related LINQ queries (like Linq to SQL or Linq to entities)


Solution

  • customers.Where(c => c.Name.Contains("john"));