I am learning a DI topic in ASP.NET 5, and I came across such a problem - I do not understand how to create a new instance of the service for each request.
I am using the code:
services.AddScoped<ValueStore>();
And inside my intermediaries, I take the meaning:
var someValueStore = app.ApplicationServices.GetService<ValueStore>();
Full code is available here.
And my problem is that although I expect this service to be updated on every request, it will not happen, and it behaves as if it were registered as AddSingleton() .
Am I doing something wrong?
source share