title: How to inject UserManager to another service in ASP.NET Core 2.0
body: <p>I created a service that uses user manager identity</p>
  
  <pre><code>public class UserManagerService : IUserManagerService
  {
      private readonly UserManager&lt;IdentityUser&gt; userManager;
  
      public UserManagerService(UserManager&lt;IdentityUser&gt; userManager)
      {
          this.userManager = userManager;
      }}
  </code></pre>
  
  <p>And I added this line to my startup.cs</p>
  
  <pre><code>services.AddTransient&lt;IUserStore&lt;IdentityUser&gt;, UserStore&lt;IdentityUser&gt;&gt;();
  services.AddTransient&lt;UserManager&lt;IdentityUser&gt;&gt;();
  </code></pre>
  
  <p>But I had this error : </p>
  
  <blockquote>
    <p>InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNet.Identity.UserManager'</p>
  </blockquote>
  
  <p>Does anyone know how we can inject user manager to another service ? </p>