title: Cannot convert from 'method group' to 'Func<string, string, bool>'
body: <p>I am implementing a very simple rules engine that enforces some specifications dynamically at runtime.</p>
  
  <p>The actual rules are stored in Tuples, and I have trouble storing a delegate to the <code>string.EndsWith</code> function.</p>
  
  <p>The following code works for testing string equality, and returns <code>False</code> as expected (<code>"A"</code> is different from <code>"B"</code>):</p>
  
  <pre><code>var rule = new Tuple&lt;string, Func&lt;string, string, bool&gt;, string&gt;("A", string.Equals, "B");
  Console.WriteLine(rule.Item2.Invoke(rule.Item1, rule.Item3));
  </code></pre>
  
  <p>However, I cannot figure out how to adapt this code to use the <code>string.EndsWith</code> function instead of <code>string.Equals</code>.</p>
  
  <p>The following code does not compile and issues a <code>Cannot convert from 'method group' to 'Func&lt;string, string, bool&gt;'</code> error message in Visual Studio.</p>
  
  <pre><code>var rule = new Tuple&lt;string, Func&lt;string, string, bool&gt;, string&gt;("A", string.EndsWith, "B");
  Console.WriteLine(rule.Item2.Invoke(rule.Item1, rule.Item3));
  </code></pre>
  
  <p>I did search before asking this question, but I cannot understand the answers provided in <a href="https://stackoverflow.com/questions/2479870/how-do-i-fix-compiler-error-cannot-convert-from-method-group-to-system-delega">How do I fix &#39;compiler error - cannot convert from method group to System.Delegate&#39;?</a> or <a href="https://stackoverflow.com/questions/29376665/cannot-convert-from-method-group-to-system-funcstring">Cannot convert from method group to System.Func&lt;string&gt;</a>. I do not see how to apply these to my problem.</p>