Closed goldenc closed 1 year ago
when using the ctor IHttpContextAccessor is regitered as a singleton https://github.com/JasperFx/alba/blob/master/src/Alba/AlbaHost.cs#L65
IHttpContextAccessor
when using the For task based api its registered as scoped https://github.com/JasperFx/alba/blob/master/src/Alba/AlbaHost.cs#L290
For
When trying to switch I'm now getting errors like Cannot consume scoped service 'Microsoft.AspNetCore.Http.IHttpContextAccessor' from singleton ...
Cannot consume scoped service 'Microsoft.AspNetCore.Http.IHttpContextAccessor' from singleton ...
Why don't they have the same lifetime ?
Good spot, will fix this now.
when using the ctor
IHttpContextAccessor
is regitered as a singleton https://github.com/JasperFx/alba/blob/master/src/Alba/AlbaHost.cs#L65when using the
For
task based api its registered as scoped https://github.com/JasperFx/alba/blob/master/src/Alba/AlbaHost.cs#L290When trying to switch I'm now getting errors like
Cannot consume scoped service 'Microsoft.AspNetCore.Http.IHttpContextAccessor' from singleton ...
Why don't they have the same lifetime ?