I`ve got a query and in one part i need to add this:
List<string> list = *some list of strings*
query = query.Where(a => list.Any(x => EF.Function.ILike(a.Name, $"{x}%")));
It worked before, but after update my ef library i got this error:
The LINQ expression 'DbSet ...' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'.
How can I change my query for workable state again? I noticed that without .Any()
it works.
query = query.Where(a => EF.Function.ILike(a.Name, "string1%") || EF.Function.ILike(a.Name, "string2%"));
But I cant do it manually. Is there a proper way to fix it?