开发者

Can my ControllerActionInvoker be a singleton?

开发者 https://www.devze.com 2023-02-18 03:03 出处:网络
It doesn\'t seem like ControllerActionInvoker has any implementation details that require a new instance to be created for each Controller.It seems to have two properties with setters that are never u

It doesn't seem like ControllerActionInvoker has any implementation details that require a new instance to be created for each Controller. It seems to have two properties with setters that are never used, and getters that are basically lazy references to static members.

I am considering changing the scope of my custom ControllerActionInvoker's life cycle in my ASP.NET MVC application. Is there a good reason I shouldn't do this? Is there something 开发者_如何转开发I'm missing about this class?


There isn't anything implicitly wrong with implementing the IActionInvoker this way.

However, there is also no implicit benefit. It depends on how you want to scope that particular component of the MVC lifecycle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号