Should I make my ASP.NET MVC controller actions virtual?

后端 未结 4 379
滥情空心
滥情空心 2021-01-12 05:19

File -> New Project for ASP.NET MVC projects used to generate controllers with virtual actions. I\'m not sure if that stopped with MVC 2 or MVC 3, but is this no longer a be

4条回答
  •  旧巷少年郎
    2021-01-12 06:01

    If you make them virtual then it will make the controllers easier to mock if you are using them in tests.

提交回复
热议问题