title: Practices to register types with IoC container?
body: <p>I have a solution with several projects (MyApp.Data, MyApp.BLL, MyApp.Web). I register types in Global.asax file in MyApp.Web (main web application):</p>
  
  <pre><code>builder.RegisterType&lt;SomeService1&gt;().As&lt;ISomeService1&gt;().InstancePerHttpRequest();
  builder.RegisterType&lt;SomeService2&gt;().As&lt;ISomeService2&gt;().InstancePerHttpRequest();
  //...etc
  </code></pre>
  
  <p>And I wonder whether it's a bad practice to register types and their scope using attributes in the other assemblies (for example, in MyApp.BLL). See below:</p>
  
  <pre><code>[Dependency(typeof(ISomeService1), ComponentLifeStyle.Transient)]
  public class SomeService1 : ISomeService1
  {
     //methods and properties go here
  }
  </code></pre>