BUG: Role records not deleted when you delete a user

Jul 14, 2014 at 1:02 AM
The following test code runs successfully, but will leave orphan Role records in the AspNetUsers table:
            var user = new ApplicationUser() { UserName = Username };

            var manager = new ApplicationUserManager(new UserStore<ApplicationUser>());

            var create = await manager.CreateAsync(user, password);
            Assert.IsTrue(create.Succeeded, create.Errors.FirstOrDefault());

            var currentUser = manager.FindByName(user.UserName);

            var roleresult = manager.AddToRole(currentUser.Id, "Superusers");
            Assert.IsTrue(roleresult.Succeeded);

            var delete = await manager.DeleteAsync(currentUser);
            Assert.IsTrue(delete.Succeeded);
Coordinator
Jul 22, 2014 at 6:46 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Sep 29, 2014 at 3:43 PM
This issue has been resolved here
Marked as answer by dotnetdavy on 9/29/2014 at 8:43 AM