entity framework - Unity singleton multiple request access ASP.Net MVC 5 -
i using mvc5 , unity. little confused reading thread safe singletons. multiple users share same singleton object? understanding singleton object created every request , 2 users each have own singleton. correct?
[update]
let have singleton
class property
instance instance. 2 users accessing website @ same time accessing same singleton object when calling instance
? scope of object? scope shared among multiple users or every user have own scope? instance return same object both users?
it depends on exact lifetime manager use. if "singleton" mean container controlled lifetime manager, instance shared users , not created lifetime of request.
on other hand, per http context lifetime managers expect.
neither has "singleton" in name, though.
Comments
Post a Comment