title: Does the IncludeAttribute add any value over the ObjectQuery and DbSet Include methods?
body: <p>I am using WCF RIA Services in combination with the Entity Framework 4.0.</p>
  
  <p>To ensure that related objects make it safely to the client, I need to first include them using the <a href="http://msdn.microsoft.com/en-us/library/bb738708.aspx" rel="nofollow">ObjectQuery(Of T).Include</a> or <a href="http://msdn.microsoft.com/en-us/library/gg696785%28v=vs.103%29.aspx" rel="nofollow">DbSet(Of TResult).Include</a> methods within my <a href="http://msdn.microsoft.com/en-us/library/ee707373%28VS.91%29.aspx" rel="nofollow">DomainService</a>. I also need to add the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.domainservices.server.includeattribute%28VS.91%29.aspx" rel="nofollow">IncludeAttribute</a> to the navigation properties within metadata classes.</p>
  
  <p>I make a <em>single</em> decision to have a related object transferred to the client and am forced to make <em>two</em> changes to implement it which seems a bit redundant.</p>
  
  <p>I am considering making modifications to the T4 templates so that all navigation properties are automatically decorated with the IncludeAttribute.</p>
  
  <p>I was a little worried about entities that were left over from previous requests being unintentionally sent to the client but my understanding is that the DomainService is stateless which should mean that this will not be the case, right?</p>
  
  <blockquote>
    <p>The point of the "DomainService" name is that it is the <a href="http://www.nikhilk.net/NET-RIA-Services-ViewModel-Pattern.aspx" rel="nofollow">stateless</a>
    object that represents a specific domain that is characteristic of my
    application.</p>
  </blockquote>
  
  <p><a href="http://mattduffield.wordpress.com/2010/11/10/visual-studio-add-in-for-domain-service-include-attribute/" rel="nofollow">Another approach</a> that I have seen was to automatically apply Include attributes to any metadata files within the project. I would still need to create the metadata files though.</p>
  
  <p>Are there any other dangers that I am not seeing? Is there a better way to achieve the same effect?</p>