I'm using Entity Framework.
Problem: search a name that start with 'a' in a list of strings:
var likeQuery = from k in dbContext.Categories
where sqlMethod.Like(k.CategoryName, "a%" ) // name start with a
select k;
foreach (var item in likeQuery)
{
Console.WriteLine(Item.);
}
Do like this.
var result
= dbContext.Categories.Where(i => i.CategoryName.StartsWith("a")).ToList();