title: How to create a Navigation Property that returns IQueryable<T> in Entity Framework
body: <p>My project uses Entity Framework 6 with Repository &amp; UnitOfWork patterns to communicate with a MSSQL database. all configurations are done with Code First. </p>
  
  <p>All of the navigation properties of the Entity Objects are defined for lazy loading as such:</p>
  
  <pre><code>public virtual ICollection&lt;&gt; Items  { get; set; }
  </code></pre>
  
  <p>this works well, and the performance is pretty good in most cases. in some cases, however, where the navigation properties refer to a large sets of data, loading them to memory takes a while, at which point LINQing seem like a bad practice. to improve performance, it would make sense to convert some of them to IQueryable&lt;> but EF doesn't seem to accept that kind of configuration.</p>
  
  <p>So although i could workaround this by "Querying" the repositories, in some cases i already have an entity object in memory and it feels right to be able to query its navigation properties without loading all of them, to get the data that i need via LINQ.</p>
  
  <p>Is there a way to make this work?</p>