title: Registering new dependency
body: <p>I am using <a href="http://www.aspnetboilerplate.com" rel="nofollow noreferrer">asp.net boilerplate</a> to create new project.</p>
  
  <p>I have defined new service as follows:</p>
  
  <pre><code>public class Employee : Entity&lt;int&gt;
  {
      public string FName { get; set; }
      public string LName { get; set; }
  }
  
  public interface IEmployeeAppService : IApplicationService
  {
      Employee AddEmployee(Employee emp);
      List&lt;Employee&gt; GetAll();
  }
  
  public class EmployeeAppService : MyTestProjectAppServiceBase, IEmployeeAppService
  {
      private IRepository&lt;Employee, int&gt; _employeeRepository;
  
      public EmployeeAppService(IRepository&lt;Employee, int&gt; repo)
      {
          _employeeRepository = repo;
      }
  
      public Employee AddEmployee(Employee emp)
      {
          return _employeeRepository.Insert(emp);
      }
  
      public List&lt;Employee&gt; GetAll()
      {
          return _employeeRepository.GetAllList();
      } 
  }
  </code></pre>
  
  <p>I want to use the service in HomeController:</p>
  
  <pre><code>public class HomeController : MyTestProjectControllerBase
  {
      IEmployeeAppService service;
  
      public HomeController(IEmployeeAppService svc)
      {
          service = svc;
      }
  }
  </code></pre>
  
  <p>When I run the application I get following error:</p>
  
  <blockquote>
    <p>Can't create component 'MyTestProject.Services.EmployeeAppService' as it has dependencies to be satisfied.</p>
    
    <p>'MyTestProject.Services.EmployeeAppService' is waiting for the following dependencies:<br>
    - Service 'Abp.Domain.Repositories.IRepository`2[[MyTestProject.Domain.Employee,
    MyTestProject.Core, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=null],[System.Int32, mscorlib, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not
    registered.</p>
  </blockquote>
  
  <p>How do I register the <code>EmployeeAppService</code> dependency with <code>HomeController</code>?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried the following code</p>
  
  <pre><code>IocManager.Register(typeof(IRepository&lt;Employee, int&gt;),
                      typeof(EmployeeAppService),
                      Abp.Dependency.DependencyLifeStyle.Transient);
  </code></pre>
  
  <p>but then it displays this error</p>
  
  <blockquote>
    <p>There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.</p>
  </blockquote>