This repository has been archived by the owner on May 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Injecting scoped services as callee #8
Comments
I'm not sure I understand your problem. What are you trying to achieve? Elad |
Cool. Does your DI support custom scopes?
|
I'm not sure about the definition of custom scope but if you mean something like here then no. we just have the Transient, Singleton and something like Request. (our DI is completely similar to .Net Core DI) |
That's a bummer, since with Ninject you could simply write: kernel.Bind<UserInfo>().ToSelf().InScope(x => WampInvocationContext.Current); |
aah, well one way for me is to see what is happening in Ninject's custom scopes and if I can add this kind of scopes to our framework. I will continue this thread if there is no easy way towards custom scopes. thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi @darkl , I'm trying to construct my callees as a service. Transient and Singleton services are working as expected, but when I inject scoped services, since there is no HTTP context available, they are created in the default scope and because of that they behave as singleton (we are using a DI pretty similar to .Net Core Di ). I found out that there is also a raw callee which exposes the invocation lifetime where I can create and dispose scopes before and after. Then I should build the wrapper again with another attribute. Is there any better way to achieve scoped invocation of callees?
The text was updated successfully, but these errors were encountered: