Entity Framework 3.0 Contains cannot be translated in SQL as it was in EF Core 2.2
It's a 3.0 bug, tracked by #17342: Contains on generic IList/HashSet/ImmutableHashSet will throw exception.
Already fixed in 3.1. The workaround (if you can't wait) is to force the usage of Enumerable.Contains
, for instance
t => tagIds.AsEnumerable().Contains(t.TagId)
or changing the type of the variable.