Create a new scope in HTTP controller dependency injection on each BeginScope call
Previous implementation used a single root scope for all HTTP requests. As the scope was never disposed, so didn't the controller & HTTP request/response objects, causing them to get accumulated in memory.
This change creates a new scope in BeginScope() API which will be disposed by request handler when the request completes. More information can be found here: Dependency Injection in ASP.NET Web API 2 - ASP.NET 4.x | Microsoft Learn
Create a new scope in HTTP controller dependency injection on each BeginScope call
Previous implementation used a single root scope for all HTTP requests. As the scope was never disposed, so didn't the controller & HTTP request/response objects, causing them to get accumulated in memory. This change creates a new scope in
BeginScope()
API which will be disposed by request handler when the request completes. More information can be found here: Dependency Injection in ASP.NET Web API 2 - ASP.NET 4.x | Microsoft Learn