All the blog posts I have written
Autofac 3.0 Final ReleasePublished:2 min read
Autofac 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 NuGetPublished:2 min read
Autofac 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 NuGetPublished:9 min read
Autofac 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) IntegrationsPublished:10 min read
This 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 22.214.171.1249 and ASP.NET MVC 4 RC Integrations ReleasedPublished:6 min read
Autofac 126.96.36.1999 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 AutofacPublished:4 min read
This 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 read
This 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 everPublished:1 min read
A 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) IntegrationPublished:2 min read
Autofac 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) IntegrationPublished:9 min read
Autofac 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.