How to create a Func<> delegate programmatically
问题 I have a small dependency injection framework, and I am trying to make it resolve Lazy<> instances dynamically. The idea is to do something like that: DIContainer.Register<IDbCommand,SqlCommand>(); var lazyCommand = DIContainer.Resolve<Lazy<IDbCommand>>(); I read the other day that Autofac was able of doing that. I am stuck trying to set the constructor for that Lazy<> instance. In the next test code, a exception is thrown because the desired type constructor is expecting a Func<arg> , but I