开发者

Does my Controller object get instantiated and destroyed from memory for every Request?

开发者 https://www.devze.com 2023-01-23 08:52 出处:网络
I just don\'t know if the Controller instance is existing in server mem开发者_开发技巧ory for a certain period of time after the Request/Response or if it just appears in memory and disappears after e

I just don't know if the Controller instance is existing in server mem开发者_开发技巧ory for a certain period of time after the Request/Response or if it just appears in memory and disappears after each Request/Response. Or if it can depend on certain things, what does it depend on?


The DefaultControllerFactory will indeed instantiate and destroy the controller instance for each request. (You can browse the source yourself, or see Dino Esposito's article Inside the ASP.NET MVC Controller Factory for a tour.)

0

精彩评论

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