title: How to use IApplicationBuilder middleware overload in ASP.NET Core
body: <p>ASP.NET Core provides two overloads for <code>app.Use()</code> method. Usually we use only one overload that is </p>
  
  <pre><code>app.Use(Func&lt;HttpContext,Func&lt;Task&gt;, Task&gt; middleware)
  </code></pre>
  
  <p>Which is used as </p>
  
  <pre><code>app.Use(async (context, next) =&gt; {
      await context.Response.WriteAsync("1st middleware &lt;br/&gt;");
      await next.Invoke();
  });
  </code></pre>
  
  <p>The other overload that i want to use is</p>
  
  <pre><code>app.Use(Func&lt;RequestDelegate,RequestDelegate&gt; middleware)
  </code></pre>
  
  <p>I couldn't find an example of how we can use this overload. Any ideas will be great.</p>