I have the following object:
CommandA (Singleton)
IFoo Foo (PerRequest)
I would like a proxy object to be injected into the singleton so that when I call Foo, it will give me the foo object that is specific to my request.
Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By design, all injections in a singleton should be singleton.
First of all, if you
CommandAis singleton, the injected objects would be singleton.Now if you say you need a new object per request, you would probably have a Factory (Singleton) in your CommandA which would create a new object or get proxy reference upon each call.
Hope that helps!