Ensure your team all use the same Controller base class
Sep 29, 2016
c#
.NET
asp.net-mvc
I’ve worked on a few asp.net MVC projects where someone has created a class which inherits from System.Web.Mvc.Controller, added some helpful code which all controllers can use and hoping that others will make use of them. Unfortunately, this doesn’t always happen and that can be sad, particularly if you have overwritten methods in the base class which take part in the application lifecycle. Luckily there’s a very easy way to make people aware of it. Write a unit test which ensures that exactly 1 class inherits from System.Web.Mvc.Controller (your custom base controller).