Enumerable Contains Enumerable

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-06-07T08:50:53Z Indexed on 2010/06/07 9:02 UTC
Read the original article Hit count: 308

Filed under:
|

For a method I have the following parameter IEnumerable<string> tags and with to query a list of objects, let's call them Post, that contains a property IEnumerable<string> Tags { get; set; }.

My question is:
How do I use linq to query for objects that contains all the tags from the tags parameter?

private List<Post> posts = new List<Post>();

public IEnumerable<Post> GetPostsWithTags(IEnumerable<string> tags)
{
  return ???;
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ