{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnetboilerplate/module-zero/issues/11","labels_url":"https://api.github.com/repos/aspnetboilerplate/module-zero/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/aspnetboilerplate/module-zero/issues/11/comments","events_url":"https://api.github.com/repos/aspnetboilerplate/module-zero/issues/11/events","html_url":"https://github.com/aspnetboilerplate/module-zero/issues/11","id":47351693,"number":11,"title":"UserManager.CreateAsync(TUser user, string password) issue an update before an insert","user":{"login":"guilmori","id":9451512,"avatar_url":"https://avatars.githubusercontent.com/u/9451512?v=3","gravatar_id":"","url":"https://api.github.com/users/guilmori","html_url":"https://github.com/guilmori","followers_url":"https://api.github.com/users/guilmori/followers","following_url":"https://api.github.com/users/guilmori/following{/other_user}","gists_url":"https://api.github.com/users/guilmori/gists{/gist_id}","starred_url":"https://api.github.com/users/guilmori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilmori/subscriptions","organizations_url":"https://api.github.com/users/guilmori/orgs","repos_url":"https://api.github.com/users/guilmori/repos","events_url":"https://api.github.com/users/guilmori/events{/privacy}","received_events_url":"https://api.github.com/users/guilmori/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-10-31T01:20:46Z","updated_at":"2015-01-28T23:15:36Z","closed_at":"2015-01-28T23:15:36Z","body":"UserManager.CreateAsync(TUser user, string password) seems to call UserStore.SetPasswordHashAsync() before calling UserStore.CreateAsync().\r\nSince AbpUserStore.SetPasswordHashAsync() is calling_userRepository.Update(user), it raise an exception because the user has not been inserted yet.\r\n\r\nTo fix, I added this check inside AbpUserStore.SetPasswordHashAsync():\r\nif(user.Id > 0) _userRepository.Update(user);"}}