title: Unity [Dependency] attribute doesn't resolve
body: <p>I have the following code, and when I try to run it, I can see that the BrokerProvider is not being resolved. Here is my code:</p>
  
  <pre><code>static void Main(string[] args)
          {
              IUnityContainer container = new UnityContainer();
              UnityConfigurationSection section = (UnityConfigurationSection) ConfigurationManager.GetSection("unity");
              section.Containers.Default.Configure(container);
  
              new TestBroker().RunTestBroker();              
          }
  
  
  class TestBroker
      {
          private IBrokerProvider brokerProvider;
  
          public void RunTestBroker()
          {
              List&lt;IPortfolio&gt; portfolios = BrokerProvider.GetPortfolios();
          }
  
          [Dependency]
          public IBrokerProvider BrokerProvider
          {
              get { return brokerProvider; }
              set { brokerProvider = value; }
          }
      }
  </code></pre>
  
  <p>The related config</p>
  
  <pre><code> &lt;unity&gt;
      &lt;typeAliases&gt;
        &lt;typeAlias alias="string" type="System.String, mscorlib" /&gt;
        &lt;typeAlias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" /&gt;
        &lt;typeAlias alias="IBrokerProvider" type="PA.Common.Interfaces.IBrokerProvider, PA.Common" /&gt;
  
        &lt;typeAlias alias="PManager" type="PA.BrokerProviders.PManager, PA.BrokerProviders" /&gt;
      &lt;/typeAliases&gt;
      &lt;containers&gt;
        &lt;container&gt;
          &lt;types&gt;
            &lt;type type="IBrokerProvider" mapTo="PManager"&gt;
              &lt;lifetime type="singleton" /&gt;
            &lt;/type&gt;
          &lt;/types&gt;
        &lt;/container&gt;
      &lt;/containers&gt;
    &lt;/unity&gt;
  </code></pre>
  
  <p>Another question: Do I need to repeat the same 3 lines of code that I have under main in every other class that I would like to use unity or setting it up once is enough?</p>