I am relatively new to LINQ and don’t know how to do a Like condition. I have an IEnumerable list of myObject and want to do something like myObject.Description like ‘Help%’. How can I accomplish this? Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look here:
http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/10/16/linq-to-sql-like-operator.aspx
Snippet:
StartsWithandContains:And if you should use it with LINQ to SQL (does not work with LINQ to Objects):
Custom
LIKE(System.Data.Linq.SqlClient.SqlMethods.Like):