Entity Framework 3.0 Contains cannot be translated in SQL as it was in EF Core 2.2
问题 I am trying to migrate a Web API from .NET Core 2.2 to .NET Core 3.0 and I have stumbled across the following: public Dictionary<int, Tag> GetTagMap(IList<int> tagIds = null) { var tags = context.Tag.AsNoTracking(); if (tagIds != null) tags = tags.Where(t => tagIds.Contains(t.TagId)); return tags .ToList() // explicit client evaluation in 3.0 .ToDictionary(t => t.TagId, t => t); } This used to generate a SQL statement similar to this one: SELECT TagId, Name FROM Tag WHERE TagId IN (1, 2, 3)