8

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?

RivieraKid
  • 5,903
  • 4
  • 37
  • 47
GraemeF
  • 11,157
  • 5
  • 51
  • 75

1 Answers1

15

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

Nicholas Blumhardt
  • 28,098
  • 4
  • 83
  • 98