Posts
All the articles I've posted.
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.
Two simple tips for working with LINQ and IEnumerable<T>
Published:3 min readThis article provides two tips for working with LINQ and IEnumerable<T>: use Any() instead of Count() to check for non-empty return values, and use Enumerable.Empty<T> and never return null.
Worst validation message ever
Published:1 min readA web service validation message was found to be difficult to understand due to its extremely technical and legal-like wording.
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.