title: What is wrong with this lambda expression?
body: <p>I am really struggling to understand why, when I change my code to use a lamdba expression, it doesn't work.</p>
  
  <p>This code works and prints on console:</p>
  
  <pre><code>object dummy = new object();
  InterServer.ExecuteDataReader(new InterServerRequest(ServerID.a_01, "dbo.getbooks") 
      { 
          Params = new Dictionary&lt;string, object&gt; { 
              { "Tool", "d1" }, 
              { "Loc", locale == string.Empty ? null : locale } } 
      },
      (_, reader) =&gt;
          {
              reader.AsEnumerable(r =&gt; (r.GetString(r.GetOrdinal("book")))).ToList().ForEach(Console.WriteLine);
              return new Response(dummy);
          }
      );
  </code></pre>
  
  <p>This code has been changed to use a lambda expression; it doesn't print anything, I don't understand why:</p>
  
  <pre><code>InterServer.ExecuteDataReader(new InterServerRequest(ServerID.a_01, "dbo.getbooks")
      { 
          Params = new Dictionary&lt;string, object&gt; { 
              { "Tool", "d1" }, 
              { "Loc", locale == string.Empty ? null : locale } } 
      },
      (_, reader) =&gt;
          {
              return new Response(new Action(() =&gt; 
                  reader.AsEnumerable(r =&gt;(r.GetString(r.GetOrdinal("book")))).ToList().ForEach(Console.WriteLine)));
          }
      );
  </code></pre>
  
  <p>This is really driving me mad as I don't see if I am doing anything wrong.  Can someone help?</p>
  
  <p>Thanks,
  AG</p>