2

I am using .NET 3.1 with Entity Framework Core 3.1. In my query, I want to look for projects where at least one of my provided search strings are contained in a project's name

var projectSearchStrings = new List<string>() { "Test", "Fake" };

var projects = from p in Projects
                where projectSearchStrings.Any(x => p.Name.Contains(x))
                select p;

when i execute this query with .ToList() i get the following Exception

The local sequence cannot be used in LINQ to SQL implementations of query operators except the Contains operator.

I already performed similar queries in an older Project using .NET Framework with EntityFramework (not Core).

Is there a way to perform such queries with a local sequence in EF Core?

Manuel Hess
  • 140
  • 9

0 Answers0