title: How to get an entity plus its child entities via RIA Services
body: <p>I'm kind of new to EF and RIA so I'm not sure if this is supposed to work or not.</p>
  
  <p>I have a simple model shown here:</p>
  
  <p><img src="https://i.stack.imgur.com/y5SqQ.png" alt="alt text"></p>
  
  <p>I added the <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/23df0450-5677-4926-96cc-173d02752313" rel="nofollow noreferrer">POCO templates for entity framework</a> and everything is wired as it sohould I can get Lazy Loading, Changes Notifications and Relationship Fixup... (I really hope you're still reading)</p>
  
  <p>The thing is that while on the server I can load a Component's SubComponents by simply calling <code>comp.SubComponents</code>. BUT, for some reason I don't have that feature on the client side... My <code>Component</code> class from the <code>RIAServices.web.g.cs</code> (generated code) does not have a list of <code>SubComponent</code>. </p>
  
  <p>Is that how that's suppose to work? Should I have a this function on the RIA Service? </p>
  
  <pre><code>public IEnumerable&lt;SubComponent&gt; GetSubComponents(int componentId)
  {
      return m_ctx.SubComponents
             .Where(x =&gt; x.Component.Id == componentId)
             .OrderBy(x =&gt; x.Name);
  }
  </code></pre>