Tag: mvc
All the articles with the tag "mvc".
OWIN support for the Web API 2 and MVC 5 integrations in Autofac
Published:5 min readAutofac has recently released pre-release packages for OWIN support for Web API and MVC 5 integrations. These packages enable dependency injection for OWIN middleware components, and extend the Autofac lifetime scope from the OWIN pipeline into the MVC and Web API integrations.
FilterAttribute Property Injection in Autofac MVC 3 Integration
Published:4 min readThe mechanism for performing property injection on FilterAttributes via ExtensibleActionInvoker had to be removed due to a bug. The new approach leverages the improved dependency injection support added to MVC 3 and requires calling the RegisterFilterProvider method before building the container and providing it to the AutofacDependencyResolver. A custom FilterAttributeFilterProvider and extension method was added to make this work.
View Page Injection in Autofac ASP.NET MVC 3 Integration
Published:5 min readASP.NET MVC 3 provides support for dependency injection on view pages via Autofac, a registration source which allows you to create an adapter that will dynamically provide a registration for a service. Your view pages must inherit from a custom base class and you need to add a registration source called ViewRegistrationSource in the application start event. This allows properties on the view page to be injected by the container.
ASP.NET MVC 3 Beta integration for Autofac
Published:5 min readThe Autofac MVC integration has been updated to provide integration with the ASP.NET MVC 3 Beta, making it easier for users by removing the need to add a reference to the Autofac.Integration.Web.dll assembly, implement the IContainerProviderAccessor interface on the HttpApplication, and register the ContainerDisposalModule in the web.config file. The core piece of the integration is the AutofacDependencyResolver which is an implementation of the IDependencyResolver interface that Brad Wilson outlines in his blog post series on ASP.NET MVC 3 Service Location. A HTTP module called RequestLifetimeModule is registered programmatically via the DynamicModuleUtility class to inform Autofac when the HTTP request has ended.
Introducing Action Injection with Autofac ASP.NET MVC Integration
Published:7 min readAutofac ASP.NET MVC Integration has introduced a new approach to dependency injection called Action Injection, which allows dependencies to be injected into action methods instead of the controller's constructor. This makes it easier to provide mock implementations for unit testing and reduces the number of mocks required.
ASP.NET MVC RTM
Published:1 min readASP.NET MVC 1.0 has been released and is available for download. Microsoft took a transparent approach with the development of MVC, and Phil Haack and ScottGu have written about its release.