title: passing in a parameter to AppFunc
body: <p>I am following <a href="http://benfoster.io/blog/how-to-write-owin-middleware-in-5-different-steps" rel="nofollow">this article</a> for understanding OWIN and with respect to points 3 and 4 in there would want to know how to pass a parameter to the Logging constructor so I can pass it in to the owin framework as shown in point #4.</p>
  
  <p>I have created the AppFunc alias using this line of code:</p>
  
  <pre><code>using AppFunc = Func&lt;IDictionary&lt;string, object&gt;, Task&gt;;
  </code></pre>
  
  <p>What is that expression on the right of the equal sign even called?</p>
  
  <p>So now my constructor is like this</p>
  
  <pre><code>    public LoggingMiddleware(AppFunc next, MyDependency dependency)
      {
  
      }
  </code></pre>
  
  <p>now how do I create the object? </p>
  
  <p>In Point #3, it says I can add a dependency object to the constructor and gives an example of how to register it using the type name. In point #4 in the article it says that you can also create an instance in advance and pass it in when registering but then it doesn't explain how to create the constructor. I tried this and did not work</p>
  
  <pre><code>LoggingMiddleware lmw = new LoggingMiddleware(new Func&lt;"",""&gt;(),depObj);
  </code></pre>
  
  <p>I want to create a constructor of LoggingMiddleware so I can register it to the OWIN framework using this line</p>
  
  <pre><code>var logger = new LoggingMiddleware(????);
  app.Use(logger);
  </code></pre>