Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "arifhshigri"

Hi,

I have updated the version of ABP (and its dependencies) from 1.0.0.0-* to 1.3.1, and since then i am facing error when i try to create user Here is my Code

[AbpAuthorize(PermissionNames.UsersCreate)]
        [UnitOfWork]
        public async Task<UserListDto> CreateUser(CreateUserInput input)
        {
            SwitchTenant(input.TenantId);
            var user = input.MapTo<User>();
            
            user.Password = new PasswordHasher().HashPassword(input.Password);
            user.IsEmailConfirmed = true;
            user.TenantId = CurrentUnitOfWork.GetTenantId();

            CheckErrors(await UserManager.CreateAsync(user));
            await CurrentUnitOfWork.SaveChangesAsync();
            await UserManager.AddToRolesAsync(user.Id, input.UserRoles.ToArray());
            return user.MapTo<UserListDto>();
        }

on UserManager.AddToRolesAsync Line it throws the following Exception "User id=x already exist " In the database when i check there is no user with id=x , and the current identity table is incremented.

Showing 1 to 1 of 1 entries