title: "Reverse-Resolution" with an Ioc Container?
body: <p>Instead of registering an interface-to-class binding, I want to register a class and have the IOC container implicitly register the interface(s) associated with that class.  I'd like to know if any IOC container can do this, though I specifically need the answer for Unity.</p>
  
  <p>To make clear what I'm after, notice:</p>
  
  <pre><code>public interface IFred
  {
      int Go();
  }
  public class Fred : IFred
  {
      public int Go()
      {
          return 1;
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          UnityContainer container = new UnityContainer();
  
          container.RegisterType&lt;Fred&gt;();     //contra-variant registration?
          IFred foo = container.Resolve&lt;IFred&gt;();  //variant resolution?
      }
  }
  </code></pre>
  
  <p>In the above example,  I want a "Fred" instance returned, even though I did not explicitly register an IFred mapping.</p>