Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happened to Lazy<T> support in Autofac?

Tags:

autofac

In beta builds of Autofac 2.1 there was support for automatic resolution of Lazy<T> as described in Nicholas Blumhardt's Lazing Around with Autofac blog post.

The code still seems to be in the source on Google Code, but I can't find LazyDependencyModule in any of the .NET 4.0 binaries I've looked at. Has it moved somewhere else?

How do I use Autofac's automatic Lazy<T> resolution with the latest Autofac builds?

like image 478
GraemeF Avatar asked Jun 19 '10 11:06

GraemeF


1 Answers

You don't need to register LazyDependencyModule yourself in the production Autofac 2 builds. It is a part of the default container, so just register T and Lazy<T> will be provided.

Make sure you're not accidentally using a .NET 3.5 binary, too :)

Nick

like image 54
Nicholas Blumhardt Avatar answered Sep 23 '22 06:09

Nicholas Blumhardt