How to select item with specific item in iCollection property?
<p>I have the following class: </p>

<pre><code> public class Foo
    {
        [Key] 
        public int ID { get; set; }

        public virtual ICollection&lt;Cat&gt; Cats { get; set; }
    }
</code></pre>

<p>I am trying to select all the Foo objects which contains a specific Cat object.  Currently I am doing this: </p>

<pre><code>Cat  c = new Cat(10);
var lPs = Bd.Foos.Include("Cats").Where(p =&gt; SomeConditions).ToList();
var lFilter = lPs.Where(p =&gt; p.Cats.Contains(c)).ToList();
</code></pre>

<p>I do not like this approach because I bring to many objects from the DB just to filter them using LinQ.</p>

<p>Is there a better(more efficient) way? </p>

<p>if it is useful, the DBcontext is defined in this way: </p>

<pre><code>modelBuilder.Entity&lt;Foo&gt;().HasMany(p =&gt; p.Cats).WithMany();
</code></pre>