title: Unity Static Property Injection
body: <p>I have two classes, one which sets up the container by registering types and one which contains a static property which I want to inject into. My issue is the property is never set by injection so when I call a method on it, the property is always null.</p>
  
  <pre><code>public class ClassOne
  {
      public void Method()
      {
          Container.RegisterType&lt;IClass, ClassImplOne&gt;("ImplOne");
          Container.RegisterType&lt;IClass, ClassImplTwo&gt;("ImplTwo");
      }
  }
  
  public static class ClassTwo
  {
      [Dependency]
      public static IClass SomeProperty { get; set; }
  
      public static void SomeOtherMethod()
      {
          SomeProperty.AnotherMethod();
      }
  }
  </code></pre>
  
  <p>If I remove the Dependency attribute and in ClassOne do a simple</p>
  
  <pre><code>ClassTwo.SomeProperty = Container.Resolve&lt;IClass&gt;("ImplOne");
  </code></pre>
  
  <p>it works fine, but I want to know if it is possible to do this without explicitly assigning a value to the property (i.e. can the container inject through attributes)?</p>
  
  <p>Edit:</p>
  
  <p>Thanks. I have removed the static declaration from ClassTwo and in ClassOne added RegisterType and Resolve for ClassTwo and also added InjectionProperty:</p>
  
  <pre><code>Container.RegisterType&lt;IClass, ClassImplOne&gt;("ImplOne", new InjectionProperty("SomeProperty"));
  </code></pre>
  
  <p>but it still does not work :S</p>