title: How better to resolve dependencies in object created by factory?
body: <p>For example I have dependency:</p>
  
  <pre><code>public interface IMyDependency
  {
  }
  
  public class MyDependency : IMyDependency
  {
  }
  </code></pre>
  
  <p>That injects in MyClass object:</p>
  
  <pre><code>public interface IMyInterface
  {
  }
  
  public class MyClass : IMyInterface
  {
      [Dependency]
      public IMyDependency MyDependency { get; set; }
  }
  </code></pre>
  
  <p>Also I have a Factory, that creates MyClass instance:</p>
  
  <pre><code>public interface IFactory
  {
      IMyInterface CreateMyObject();
  }
  
  
  public class Factory : IFactory
  {
      public IMyInterface CreateMyObject()
      {
         // some checks before creation
         // for. ex check if this type of object supported by OS and thow    exception if not
  
           return new MyClass();
      }
  }
  
  ...
  container.RegisterType&lt;IFactory, Factory&gt;();
  </code></pre>
  
  <p>If I create MyClass instance with "new" keyword my dependencies will not be resolve. Or I should escape from Factory and move logic into constructor of MyClass? And after  register it in container like container.RegisterType()?</p>