What happens if i dispose a HttpContextScoped() object during a session and try get an instance to it again? Will it recreate it?
What happens if i dispose a HttpContextScoped() object during a session and try get
Share
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.
Of course not. How should StructureMap know that you disposed it? It can’t magically hook an event on that object or wrap it in some sort of dynamic proxy for you. That’s just too much magic (and don’t forget the overhead). Just don’t expose services to the application that implement
IDisposable.IDisposableis a leaky abstraction.