The title is very clear. I have an application-BaseController which inherits from “Controller”-class now.
With the new .NET Framework 4.5 and the ASP.NET MVC 4, I would like to use the new simpler async functionality which is available in C# 5. I like to use a few action methods with the async functionality (not all).
Are there any pitfalls to change the current base class from “Controller” to “AsyncController”? (worse performance for non async action methods?)
So what do you think about it?
Thanks for each answers.
Edit: With ILSpy I saw, the AsyncController-class doesn’t contains any code in it (MVC 4). As @Trevor Pilley said, it is only there for backwards compatibility with MVC 3.
public abstract class AsyncController : Controller
{
}
So, we don’t need us to care about “AsyncController” or “Controller” base. The “Controller”-class does handle both now in MVC 4.
If you are moving to MVC 4, the Controller class supports the async stuff. The AsyncController is only there for backwards compatibility with MVC 3.
AsyncController Class – “The Controller class in ASP.NET MVC 4 and higher supports the asynchronous patterns.”
With that in mind, I’d say it probably doesn’t make much if any difference & wouldn’t worry about it.