title: NInject and MVC 3 - Should I use DependencyResolver instead of [Inject] attribute?
body: <p>Recently I moved to MVC 3 and Ninject 2. In most of the code, I use constructor injection, but there are some places, where I had to use <code>Inject</code> attribute. Ninject 2 registers its own <code>IDepencyResolver</code> interface. I don't like <code>DependencyResolver</code> class being part of <code>System.Web.Mvc</code> namespace, because its function is not really strictly related to MVC, but now, when it is there, I can do</p>
  
  <pre><code>public SomeClass 
  {
      public IUserService UserService { get; set; }
  
      public SomeClass()
      {
          UserService = DependencyResolver.Current.GetService&lt;IUserService&gt;();
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>public SomeClass 
  {
      [Inject]
      public IUserService UserService { get; set; }
  </code></pre>
  
  <p>so I don't have to reference <code>Ninject</code> namespace in my classes. Should <code>DependencyResolver</code> be used like that?</p>