title: Entity Framework populating child entities without asking
body: <p>We're pulling data for Users using Entity Framework code similar to what is below:</p>
  
  <pre><code>using (DataContext db = new DataContext())
  {
      var users = db.Users.Include("Roles.Role");
  }
  </code></pre>
  
  <p>This effectively gets the Roles and Logins that we're looking for. However, because Role also has Users on it for the users in that role, it's also being populated. That means we get a result similar to what's below:</p>
  
  <pre><code>[{
          "roles" : [{
                  "userId" : 1,
                  "roleId" : 1,
                  "role" : {
                      "users" : [{
                              "userId" : 4,
                              "user" : {
                                  "roles" : [],
                                  "firstName" : "Jill",
                                  "lastName" : "Doe",
                                  "id" : 4
                              },
                              "roleId" : 1
                          }, {
                              "userId" : 1,
                              "user" : {
                                  "roles" : [],
                                  "firstName" : "John",
                                  "lastName" : "Doe",
                                  "id" : 1
                              },
                              "roleId" : 1
                          }
                      ],
                      "id" : 1,
                      "name" : "Administrator"
                  }
              }
          ],
          "firstName" : "John"
          "lastName" : "Doe"
          "id" : 1
      }]
  </code></pre>
  
  <p>We're not explicitly requesting that the Users on the Role be loaded, but it seems like it's loading them because it already knows who they are because it loaded the users as part of the main request.</p>
  
  <p>We have lazy loading disabled and do not have any properties marked a <em>virtual</em>.</p>
  
  <p>Is there anyway to keep it from doing this? I did some searching and most people are asking how to get child objects to populate, not how to keep them from populating when they're not requested.</p>
  
  <p>UPDATE: To further explain, this is happening before any sort of serialization by ASP.NET, immediately after it comes from the data context, and we are not getting any reference loops when the objects are serialized from WebAPI.</p>