title: Passing a FSharpFun from C# to F#
body: <p><strong>F#</strong> Definition of a function in a module.</p>
  
  <pre><code>module ClassLibrary1.Functions
  
  let checkThis item f =
      if f item then
          printfn "HIT"
      else
          printfn "MISS"
  </code></pre>
  
  <p><strong>f# unit tests - works</strong></p>
  
  <pre><code>[&lt;TestMethod&gt;]
      member this.TestFunctions() =
          checkThis 5 (fun x -&gt; x &gt; 3)
  </code></pre>
  
  <p><strong>in c# unit test</strong></p>
  
  <pre><code>using ClassLibrary1;
  
  namespace TestProject
  {
      [TestClass]
      public class UnitTest1
      {
  
          [TestMethod]
          public void TestFunctions()
          {
              FSharpFunc&lt;int, bool&gt; s = x =&gt; x &gt; 3 // error, how to declare?
              Functions.checkThis(5, s);
          }
       }
  }
  </code></pre>
  
  <p>Error</p>
  
  <blockquote>
    <p>Cannot conver initializer type "lambda expression" to target type</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Screenshots to help the answer.</p>
  
  <p><a href="https://i.stack.imgur.com/ntTmU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ntTmU.png" alt="enter image description here"></a></p>
  
  <p>Screenshot 3</p>
  
  <p><a href="https://i.stack.imgur.com/M6REz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M6REz.png" alt="enter image description here"></a></p>