Tag: autofac
All the articles with the tag "autofac".
Autofac 3.0 Final Release
Published:2 min readAutofac 3.0 is the final release, with the biggest changes being an official SignalR integration and plenty more documentation on the wiki. The NuGet packages and download zips are now available, along with a list of bug fixes, core and extra NuGet packages.
Autofac 3.0 Beta 2 packages available on NuGet
Published:2 min readAutofac 3.0 Beta 2 is now available on NuGet and includes a number of enhancements and bug fixes, such as the addition of AutoActivate() registration extension, better integration with MVC 4 and Web API filters, and various other improvements and updates to dependencies.
Autofac 3.0 Beta packages available on NuGet
Published:9 min readAutofac 3.0 Beta packages are now available on NuGet, and feature a Portable Class Library that supports multiple frameworks such as .NET Framework 4, Silverlight 5, .NET for Windows Store apps, and Windows Phone 8. It includes XML configuration options, metadata support, an improved registration extension, and bug fixes and enhancements.
New features in the Autofac MVC 4 and Web API (Beta) Integrations
Published:10 min readThis post outlines the new features in the latest pre-release NuGet packages for the Autofac integrations with MVC 4 and Web API. These features include registering filters without attributes, registering per-controller type services, and supporting InstancePerApiControllerType lifetimes.
Autofac 2.6.2.859 and ASP.NET MVC 4 RC Integrations Released
Published:6 min readAutofac 2.6.2.859 was released and includes updates to the core library, ASP.NET MVC 4 RC integration, and ASP.NET Web API RC integration. The core library updates include a new module scanning feature and performance improvements. The ASP.NET MVC and Web API integrations are just recompilations but will have additional features included for the official release.
Selectively resolving services at runtime with Autofac
Published:4 min readThis article explains how to selectively resolve a service at runtime with Autofac by making use of the IEnumerable<Lazy<IExport, IExportMetadata>> and Lazy<T, TMetadata> relationship types. It also provides an example of how to refactor the controller constructor to receive the list of exports and how to query the metadata to select the correct export service at runtime.
Autofac ASP.NET MVC 4 (Beta) Integration
Published:2 min readAutofac 2.6.1 has released a MVC 4 Beta integration, available for download via NuGet, with no breaking changes from the MVC 3 version. The minor change made in the internals allows the lifetime scope applied to a registration to be shared between MVC and the Web API. Users should report any bugs on the issue tracker or ask questions on Stack Overflow using the “autofac” tag.
Autofac ASP.NET Web API (Beta) Integration
Published:9 min readAutofac has released a beta version of the ASP.NET Web API integration package for NuGet, which supports both web hosting and self hosting scenarios. The integration allows for services to be registered per API controller invocation. A HTTP module style implementation is not required due to the IHttpControllerFactory interface allowing for an abstraction between the two hosting modes. The implementation details are discussed in the article.
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.