title: IEnumerable methods
body: <p>I found this example in a C# book, can someone explain why can you pass the Fibs method into the EvenNumbersOnly method when it only expects a list?    </p>
  
  <pre><code>static void Main()
  {
      foreach (int fib in EvenNumbersOnly (Fibs(6)))
          Console.WriteLine (fib);
  }
  
  static IEnumerable&lt;int&gt; Fibs (int fibCount)
  {
     for (int i = 0, prevFib = 1, curFib = 1; i &lt; fibCount; i++)
     { 
          yield return prevFib;
          int newFib = prevFib+curFib;
          prevFib = curFib;
          curFib = newFib;
     }
  }
  
  static IEnumerable&lt;int&gt; EvenNumbersOnly (IEnumerable&lt;int&gt; sequence)
  {
     foreach (int x in sequence)
         if ((x % 2) == 0) {
          yield return x;
         }    
  }
  </code></pre>