title: How to create a nuget package that can be injected with little client registration?
body: <p>I'm new to nuget packages. </p>
  
  <p>Let's say I have a simple nuget package that contains 2 classes, 1 of which I want to expose to the public - my <code>WidgetService</code>. </p>
  
  <pre><code> public class WidgetService: IWidgetService
   {
     private readonly IWidgetFactory _factory; 
  
     public WidgetService(IWidgetFactory factory)
     {
       _factory = factory;
     }
  
     public IWidget CreateWidget()
     {
        return _factory.Create();
     }
   }
  </code></pre>
  
  <p>Now I have a client app that pulled in the nuget package and uses dependency inversion like so: </p>
  
  <pre><code> public class MyWidgetClass : IMyWidgetClass
   {
     private readonly IWidgetService _widgetService;
  
     public MyWidgetClass(IWidgetService widgetService) 
     {
        _widgetService = widgetService;
     }
  
     public void DoTehThing()
     {
        var widget = _widgetService.Create();
  
        ... // do things with the widget
     }    
   }
  </code></pre>
  
  <p>Assuming the client app was using a DI framework (but we might not know which one), at a minimum what would the client have to register with their DI framework to utilize this code, if anything? </p>
  
  <p>My goal is to figure out how sophisticated nuget packages expose a few simple interfaces and the rest of the dependencies are taken care of without a client app having to worry about it. </p>