title: Ninject: give the parent instance to a child being resolved
body: <p>I have this class hierarchy:</p>
  
  <pre><code>public interface ISR { }
  public interface ICU { }
  public interface IFI { }   
  
  public class CU : ICU { }
  
  public class SR : ISR
  {
      public SR(IFI fi)
      {
          FI = fi;
      }
  
      public IFI FI { get; set; }
  }
  
  public class FI : IFI
  {
      public FI(ISR sr, ICU cu)
      {
          SR = sr;
          CU = cu;
      }
  
      public ISR SR { get; set; }
      public ICU CU { get; set; }
  }
  
  public class Module : NinjectModule
  {
      public override void Load()
      {
          Bind&lt;ISR&gt;().To&lt;SR&gt;();
          Bind&lt;ICU&gt;().To&lt;CU&gt;();
          Bind&lt;IFI&gt;().To&lt;FI&gt;();
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          var kernel = new StandardKernel(new Module());
  
          var sr = kernel.Get&lt;ISR&gt;();
      }
  }
  </code></pre>
  
  <p>When I run this code, I have an exception because I have a cyclic dependency. The SR class needs an instance of IFI to be injected in order to be completed, and the FI class needs an instance of ISR to be injected.</p>
  
  <p>Of course, using a property injection doesn't solve this issue.</p>
  
  <p>I have a particularity though: I need ISR to be constructed first, and it is this instance which must be given to FI. So ISR and IFI need to share a scope.</p>
  
  <p>How would you solve that with Ninject?</p>