title: web api entity framework: return all the data whatever the query is
body: <p>I'm using Entity Framework in asp.net web api and i have a problem with IHttpActionResult, it is returning all the the database data even when i just want to get data by id.
  I have a Player class, and a PlayerStat classe, each player many rows of stats according to the number of season he played.
  If i try to get a Player Name, it is fine, but when i try to access player Stats, evry thing goes mad !
  instead of having the player stat for each season, i get all the data in my database</p>
  
  <pre><code>public partial class Player
      {
          public Player()
          {
              this.PlayAt = new HashSet&lt;PlayAt&gt;();
              this.PlayerStat = new HashSet&lt;PlayerStat&gt;();
          }
  
          public int IDPlayer { get; set; }
          public string NamePlayer { get; set; }
          public Nullable&lt;int&gt; Height { get; set; }
          public Nullable&lt;int&gt; Weight { get; set; }
          public string Country { get; set; }
          public Nullable&lt;System.DateTime&gt; DateBirth { get; set; }
          public string StartPlay { get; set; }
  
          public virtual ICollection&lt;PlayAt&gt; PlayAt { get; set; }
          public virtual ICollection&lt;PlayerStat&gt; PlayerStat { get; set; }
      }
  
  public partial class PlayerStat
  {
      public int IDPlayer { get; set; }
      public string IDSeason { get; set; }
      public int Age { get; set; }
      public string IDTeam { get; set; }
      public string Pos { get; set; }
      public Nullable&lt;int&gt; G { get; set; }
      public Nullable&lt;int&gt; GS { get; set; }
      /*Other Stat like GS*/
  
      public virtual Player Player { get; set; }
      public virtual Season Season { get; set; }
      public virtual Team Team { get; set; }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The request:</p>
  
  <pre><code> public IHttpActionResult GetPlayer(int id)
      {
          var statsQuery = from pl in db.Player where pl.IDPlayer == id select pl.PlayerStat;
  
          if (statsQuery == null)
          {
              return NotFound();
          }
          return Ok(statsQuery);
      }
  </code></pre>