title: Dependency Injection with C# - Where to load the data for the Resolved Objects
body: <p>Quick Dependency Injection / IoC Container question that will hopefully be an easy one for a seasoned developer.  I am newer to DI, and have the basics of the process down for registering the types and resolving them for building the instances using constructor injections, but have a question about the process for loading their instances with data and when/where to do that correctly.<br>
  So if you have an object that has been resolved to build the object with the DI container - it will load a hollow object, but at what point are you suppose to load the object with its needed data?  </p>
  
  <p>For Example: 
  If you have a IPerson interfaces that is implemented by Student class, and Principal class.  And you have a ISiteVisit interface that is implemented by SiteVisit and you resolve in the following fashion:</p>
  
  <pre><code>        var dictr = new UnityContainer();
          dictr.RegisterType&lt;IPerson, Principal&gt;();
          dictr.RegisterType&lt;IVisitSite, SiteVisit&gt;();
  
          var siteVisit = dictr.Resolve&lt;IVisitSite&gt;();
          siteVisit.Visit();
  </code></pre>
  
  <p>Where would you load up the details for the Person (in the example class is: Principal) for data such as FirstName, LastName, PhoneNumber, Address, etc.. - anything relevant to the Person?  Would it be loaded in the constructor, if not what is the best place to load it, best convention and/or best practices?</p>
  
  <p>Should you ideally use Dependency Injection with every Interface in your application, or just certain models?</p>
  
  <p>How do you load data into the resolved objects when you are using Dependency Injection?</p>
  
  <p>Environment:  Visual Studio 2015, C#, Unity for DI / Container  (using Console app for testing this)</p>