Does Structuremap support Lazy out of the box?
问题 Does structuremap allow you to do constructor injection in a lazy fashion? Meaning not creating the object which is injected until it is used? 回答1: UPDATE: StructureMap v3 implements this out of the box, so this trick is no longer necessary. StructureMap version 2 doesn't, but with a few tricks you can get it to do what I believe you are looking for. First of all, you can already wire up Lazy<T> instances manually like this: container = new Container(x => { x.Scan(y => { y.TheCallingAssembly(