autofac

Should I register ViewModels in Container?

Should I register ViewModels in Container and resolve from there? Benefits: I can perform some actions when view model is activated Container will inject dependencies for me ??? Drawbacks: ViewModel lifetime management can be tricky: if I make ViewModel singleton then I can't instantiate several controls of the same type if I mak...

Autofac with ASP.NET MVC 2 loads controllers 2 times

Hi all, i'm developing an application that uses ASP.NET MVC 2 and autofac latest release. I've developed a custom mvc helper method that allow me to easily display a custom text input in the form like this: <%: Html.MyMethod("blabla") %> The method generate a string, put it as the input value and save it also in a session. The problem...

Autofac - Register plugins by type

Hi all, I'm writing a plugin system: every plugin is in his own assembly that must be loaded by autofac and is signed by an attribute with a parameter that set the type of plugin. I would be able to resolve in my asp.net mvc app the plugins by type, how can I do this? Every plugin inhrerit by an abstract class and override predefinited m...