title: Parsing Expressions as a parameter
body: <p>I'm trying to write a method which can be called like this:</p>
  <pre><code>var myCommand = Command.Where(x =&gt; x.Name == &quot;grep&quot; &amp;&amp; x.Switch == &quot;x&quot;);
  </code></pre>
  <p>What I'm trying to do is parse the resulting expression like so:</p>
  <pre><code>public static string FindBy(Expression&lt;Func&lt;T, bool&gt;&gt;  expression)
  {
      var condition1Key = ? //condition1Key = &quot;Name&quot;
      var condition1Value = ? //condition1Value = &quot;grep&quot;
      var condition2Key = ? //condition1Key = &quot;Switch&quot;
      var condition2Value = ? //condition1Value = &quot;x&quot;
      
     return string.Format(&quot;Looking for commands with {0} = {1} and {2} = {3}&quot;,
                           condition1Key, condition1Value, 
                           condition2Key, condition2Value);
  }
  </code></pre>
  <p>I did find <a href="https://stackoverflow.com/questions/1473289/use-lambda-expressions-as-a-parameter">this post</a> but it is quite old and never received a proper answer.</p>
  <h3>How can I parse the incoming <code>Expression</code> to pull out what I need?</h3>