I'm trying to create ASP.NET MVC module by using MEF. While I have no problems so far by using MEF without MVC, when it comes to exporting Controllers I have some difficulties.
I used this approach as example http://kennytordeur.blogspot.de/2012/08/mef-in-aspnet-mvc-4-and-webapi.html I made it more complex by introducing an external dll, which contained a controller. But if I follow the idea of Kenny, then I need to have a common interface (like IMyTest in his example), however, as I plan to have a number of controllers, it would mean that I will need too many interfaces. And in the end, it looks like I reuse inner methods of controllers, instead of whole controllers.
I found a question here How to integrate MEF with ASP.NET MVC 4 and ASP.NET Web API, which contained some code examples, where I see the similar picture - _contactRepository of an interface IContactRepository is imported and then reused inside a view.
That is why my question is, is it normal to export the whole controller, without using interfaces? And how to do so?
I found the connection between MEF and ASP.NET quite confusing, at first it seams that there are a number of examples in the Internet, but when I look deeper, most of them are outdated and not practical or too primitive to see how it can be applied to bigger projects.
Thanks!