Imagine I have the following DbSet
:
public class X {
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Y> YCollection { get; set; }
}
When I want to retrieve item 1 of X
I execute DbSet<X>.Find(1);
which returns me an EF proxy object.
Now that this proxy object (X
) contains multiply Y
's I'd like to retrieve YCollection
as a IQueryable<Y>
. (Mainly to do some additional filtering on it before retrieving it from the database.)
How can I retrieve YCollection
as IQueryable<Y>
?