title: Does .net core dependency injection support Lazy<T>
body: <p>I am trying to use the generic Lazy class to instantiate a costly class with .net core dependency injection extension. I have registered the IRepo type, but I'm not sure what the registration of the Lazy class would look like or if it is even supported. As a workaround I have used this method <a href="http://mark-dot-net.blogspot.com/2009/08/lazy-loading-of-dependencies-in-unity.html" rel="noreferrer">http://mark-dot-net.blogspot.com/2009/08/lazy-loading-of-dependencies-in-unity.html</a></p>
  
  <p>config: </p>
  
  <pre><code>public void ConfigureService(IServiceCollection services)
  {
      services.AddTransient&lt;IRepo, Repo&gt;();
      //register lazy
  }
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>public class ValuesController : Controller 
  {
      private Lazy&lt;IRepo&gt; _repo;
  
      public ValuesController (Lazy&lt;IRepo&gt; repo)
      {
          _repo = repo;
      }
  
      [HttpGet()]
      public IActionResult Get()
      {
           //Do something cheap
           if(something)
               return Ok(something);
           else
               return Ok(repo.Value.Get());
      }
  }
  </code></pre>