I was reading the MS doc about DI in .Net Core.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2
I came across the line
"Warning
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."
Anyone, please explain what is the meaning of this?
Then one of the most voted answer here uses constructor DI injection for scoped service. AddTransient, AddScoped and AddSingleton Services Differences?