You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of the developers was that InvocationContext derivatives would provide a reference to a scoped IServiceProvider.
unfortunately ApiBase is singleton and InvocationContext derivates are (and were) instantiated with Api.ServiceProvider as reference. This means that they receive a non scoped container and All AddScoped<> services will effectively return a singleton.
services.AddScoped<RestierQueryExecutorOptions>() is an example where it goes horribly wrong. A single RestierQueryExecutorOptions instance is used, which makes multiple concurrent queries with and without TotalCount possibly get the wrong results or no count where one was requested or vice versa.
It seems I was wrong. ApiBase is scoped, although the documentation suggests it's not. The documentation talks about the Configuration being singleton, and I incorrectly assumed that ApiBase would be singleton in Total.
The idea of the developers was that InvocationContext derivatives would provide a reference to a scoped IServiceProvider.
unfortunately ApiBase is singleton and InvocationContext derivates are (and were) instantiated with Api.ServiceProvider as reference. This means that they receive a non scoped container and All AddScoped<> services will effectively return a singleton.
SubIssue of #13.
The text was updated successfully, but these errors were encountered: