title: .NET Core DI without constructor arguments
body: <p>Until now, I have used the Unity IOC container to resolve dependencies, which works just fine. With the Unity DI, I normally resolve instances in the following way:</p>
  
  <pre><code>Public class TestClass {
      public TestClass()
      {
          var instance = IOC.resolve&lt;InterfaceClassToResolve&gt;();
      }
  }
  </code></pre>
  
  <p>This works great, but seeing that .net core now provides me with an out of the box DI container, I would much rather like to use that - There is just one problem compared to the Unity IOC, namely that it is injected as a constructor argument, and not resolved like the example above. </p>
  
  <p>In most cases, I figured that it forces me to chain my dependencies throughout multiple classes, instead of just resolving my dependency in the classes that actually needs them. </p>
  
  <p>I have been looking at ways to solve this, and as far as I can see, the only option is to do something like this: </p>
  
  <pre><code>Public class TestClass {
      public TestClass(IServiceProvider serviceProvider)
      {
          var instance = serviceProvider.GetService&lt;InterfaceClassToResolve&gt;();
      }
  }
  </code></pre>
  
  <p>And then we are back to square one again...</p>
  
  <p>Therefore, am I missing some of the functionality behind the .net core IOC, or is there some secret sauce to why most examples wants me use the .net core IOC via constructor arguments?</p>