title: Has ASP.NET Identity UserManager.CreateAsync() been updated with breaking changes recently?
body: <p>A few months ago I created my own implementation of ASP.NET Identity, overriding the UserStore to use dapper and a custom sql connection instead of Entity Framework. It worked fine at the time.</p>
  
  <p>Now I updated all of the nuget packages today and I've been fighting problems since. Primarily when I register a new user by calling  <code>var result = await UserManager.CreateAsync(user, newAccount.Password);</code> It creates the user and performs all other checks just fine, but then throws a bizarre error saying <code>Invalid operation. The connection is closed.</code></p>
  
  <p>Its as though UserManager.CreateAsync has a new method that needs to be overridden, but I have absolutely no idea what it could be.</p>
  
  <p>For reference, here are parts of my implementation:</p>
  
  <p><strong>Account Controller:</strong></p>
  
  <pre><code>        [Authorize]
              public class AccountController : Controller
              {
  
                  public UserManager&lt;User&gt; UserManager { get; private set; }
                  public UserTokenProvider UserTokenProvider { get; set; }
  
                  public AccountController() : this(new UserManager&lt;User&gt;(new UserStore(ConfigurationManager.ConnectionStrings["DBConn"].ConnectionString)))
                  {
                  }
  
                  public AccountController(UserManager&lt;User&gt; userManager)
                  {
                      UserManager = userManager;
                      UserManager.PasswordHasher = new NoPasswordHasher();
  
                  }
  
  ...
  
          [HttpPost]
          [AllowAnonymous]
          [ValidateAntiForgeryToken]
          public async Task&lt;ActionResult&gt; Register(RegistrationModel newAccount)
          {
              try
              {
                  if (DbConfig.MaintenanceMode) return RedirectToAction("ComingSoon", "Home");
                  if (ModelState.IsValid)
                  {
                      var user = new User(newAccount);
  
                      var result = await UserManager.CreateAsync(user, newAccount.Password);
                      if (result.Succeeded)
                      {
                          await SignInAsync(user, isPersistent: false);
                          var userIn = await UserManager.FindByEmailAsync(newAccount.UserName);
                          if (!userIn.EmailConfirmed)
                          {
                              await SendValidationEmail(userIn);
                              return RedirectToAction("ConfirmationSent", new {userName = user.UserName});
                          }
                          return RedirectToAction("Index", "Home");
                      }
                      else
                      {
                          AddErrors(result);
                      }
                  }
  
                  // If we got this far, something failed, redisplay form
                  return View(newAccount);
              }
              catch (Exception ex)
              {
                  var msg = ex.Message;
  
                  return View(newAccount);
              }
          }
  </code></pre>
  
  <p><strong>User Store:</strong></p>
  
  <pre><code>    public class UserStore : IUserStore&lt;User&gt;, IUserLoginStore&lt;User&gt;, IUserPasswordStore&lt;User&gt;, IUserSecurityStampStore&lt;User&gt;, IUserRoleStore&lt;User&gt;, IUserEmailStore&lt;User&gt;
          {
              private readonly string _dbConn;
  
  
              public UserStore(string conn = null)
              {
                  if (conn != null)
                      _dbConn = conn;
                  else
                      _dbConn = DbConfig.ConnectionString;
              }
  
              public void Dispose()
              {
              }
  
  
  
              public virtual Task CreateAsync(User user)
              {
                  using (var _conn = new SqlConnection(_dbConn))
                  {
                      if (_conn.State == ConnectionState.Closed) _conn.Open();
                      return _conn.ExecuteAsync("users_UserCreate",
                          new
                          {
                              @UserId = user.Id,
                              @UserName = user.UserName,
                              @PasswordHash = user.PasswordHash,
                              @SecurityStamp = user.SecurityStamp
                          }, commandType: CommandType.StoredProcedure);
  
                  }
              }
  
  ... Remaining methods omitted for brevity ...
  </code></pre>
  
  <p>You'll notice that the UserStore.CreateAsync() function has <code>if (_conn.State == ConnectionState.Closed) _conn.Open();</code> as this was the suggestion from multiple threads regarding the connection closed error. Even without this line the query works fine and inserts a new user into the database correctly.</p>
  
  <p>The error is coming from somewhere after UserStore.CreateAsync() is called by UserManager.CreateAsync().</p>
  
  <p>Any idea what's missing?</p>