title: Linq filter returned data repeated
body: <p>I am trying to filter a list of object using Linq method Where, however, after filter execution the list returned the first element that fulfilled the condition repeated across the whole list (i.e., repeated the number of times for other elements fulfilling the condition too). For example, I am returning employees only with country id = 3 and I should have three employees Green, Blue, and Red, however, I got only Blue repeated 3 times Blue, Blue, Blue.</p>
  
  <p>I am using MySql as my backing store and I am using Entity Framework with MySqlConnection object </p>
  
  <pre><code>public class Repository&lt;T&gt; : IRepository&lt;T&gt; where T : class
  {
      public IEnumerable&lt;T&gt; SelectAll()
      {
          return db.Set&lt;T&gt;().ToList();
      } 
  }
  
  
  public class AnalyticsRepository : Repository&lt;Analytics&gt;
  {
      public new List&lt;Analytics&gt; SelectAll()
      {
          return base.SelectAll().ToList&lt;Analytics&gt;();
      }
  }
  
  public IEnumerable&lt;Analytics&gt; SelectByCountryAndProduct(string countrycriteria, string productcriteria)
  {
      List&lt;Analytics&gt; result = null;
  
      using (AppDbContext db = new AppDbContext(factory.GetConnection()))
      {
          db.Database.CommandTimeout = 6000;
          analyticsRepository = new AnalyticsRepository(db);
          result = analyticsRepository.SelectAll();
      }
  
      return result
          .Where( a =&gt; a.CountryId.ToString() == countrycriteria &amp;&amp; a.ProductId.ToString() == productcriteria)
          .ToList();
  }
  </code></pre>
  
  <p>Debugging and trying another sample solution on a list with dummy data which is worked fine</p>