title: Why IEnumerable<T> method call the database without condition?
body: <p>I have these method in my Generic Repository :</p>
  
  <pre><code>public IQueryable&lt;T&gt; Query()
  {
      return _dbSet.AsQueryable();
  }
  
  public IEnumerable&lt;T&gt; Enum()
  {
      return _dbSet.AsEnumerable();
  }
  </code></pre>
  
  <p>If I call these method in my service layer</p>
  
  <pre><code>_repo.Query().Where(w =&gt; w.IsActive == true);
  _repo.Enum().Where(w =&gt; w.IsActive == true);
  </code></pre>
  
  <p>The Queryable method will call this TSQL Syntax in the database, profiler below :</p>
  
  <pre><code>SELECT 
      [Extent1].[ProjectID] AS [ProjectID], 
      [Extent1].[Name] AS [Name], 
      [Extent1].[IsActivity] AS [IsActivity], 
      [Extent1].[IsActive] AS [IsActive]
      FROM [dbo].[Project] AS [Extent1]
      WHERE 1 = [Extent1].[IsActive]
  </code></pre>
  
  <p>which is expected, but the Enumerable method will select everything in the database without where condition, profiler below :</p>
  
  <pre><code>SELECT 
      [Extent1].[ProjectID] AS [ProjectID], 
      [Extent1].[Name] AS [Name], 
      [Extent1].[IsActivity] AS [IsActivity], 
      [Extent1].[IsActive] AS [IsActive]
      FROM [dbo].[Project] AS [Extent1]
  </code></pre>
  
  <p>It means that the Enumerable will greedily call every record in the database including <code>IsActive = 0</code> record. Why is this happening? I thought IEnumerable is suppose to be deffered which means it won't do anything until something like <code>ToList()</code> is called.</p>
  
  <p>Any help will be appreciated and apologize for bad english.</p>