Register Areas

Mar 7, 2013 at 9:22 PM

I'm working on a large MVC app that required my group to make plug-able areas something similar to this Now I'm trying to make use of Munq in my MVC app to register the Areas and cant figure out what I need to do to register Areas.

I was looking at this article which states "Note: This version of the MunqControllerFactory does not support the Areas feature of MVC 2. This too will be corrected in a future article."

I guess the questions is how can I register an Area using Munq?

Mar 8, 2013 at 2:08 AM
The Munq.MVC3 package on Nuget adds Munq to your MVC3 or 4 application. Areas are handled correctly as the MVC framework asks the IOC container for a Class, not an instance, and Munq knows how to create classes without registering the classes in advance.

The first time it creates an instance of a Class, it uses Reflection to determine the Constructor with the most parameters, and then creates a delegate which uses this constructor, calling Munq.Resolve(Type type) for each of the parameters.

So, while I haven't tried this particular scenario, it should just work without any Registering of the Areas in Munq.