title: What is the meaning of "When using a scoped service, inject the service into the Invoke or InvokeAsync"?
body: <p>I was reading the MS doc about DI in .Net Core. </p>
  
  <p><a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2</a></p>
  
  <p>I came across the line </p>
  
  <blockquote>
    <p>"Warning</p>
    
    <p>When using a scoped service in a middleware, inject the service into
    the Invoke or InvokeAsync method. Don't inject via constructor
    injection because it forces the service to behave like a singleton."</p>
  </blockquote>
  
  <p>Anyone, please explain what is the meaning of this?</p>
  
  <p>Then one of the most voted answer here uses constructor DI injection for scoped service.
  <a href="https://stackoverflow.com/questions/38138100/addtransient-addscoped-and-addsingleton-services-differences">AddTransient, AddScoped and AddSingleton Services Differences?</a></p>