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 was looking for the same answer and not being satisfied with the syntactic cleanliness of the answers provided, I kept looking and found this post.
tl;dr; - add class to your constraints and it works.
LINQ to Entities only supports casting EDM primitive or enumeration types with IEntity interface
public static IQueryable WhereTagged(this IQueryable set, string tag)
where T: class, ITaggable