I have a simple extension method for filtering a LINQ IQueryable by tags. I\'m using this with LINQ to Entities with an interface of:
public interface ITaggable
I suspect that the problem arises from the call to s.Tags. Because s is a Product, but you're calling ITaggable.Tags, the expression that gets generated looks more like:
set.Where(s=>((ITaggable)s).Tags.Any(...))
That just confuses Entity Framework. Try this:
((IQueryable)set)
.Where(s=>s.Tags.Any(t=>t.Name.ToLower() == tag.ToLower()))
.Cast();
Since IQueryable is a covariant interface, this will treat the set as an IQueryable, which should work since your second example basically does exactly the same thing.