Base solution for your next web application
Open Closed

Extend AbpUserAccounts table example #1294


User avatar
0
justin created

I want to extend AbpUserAccounts table and UserAccounts object to support IsEmailVerified and IsPhoneVerifed column. I want to add verification of both these property during registration. Unless this functionality is already available , which i did not see. Is there an example of adding new columns and extending object for ABP?

Also i did not see any suporting function similar to UserManager.GenerateEmailConfirmationTokenAsync(long)


3 Answer(s)
  • User Avatar
    0
    justin created

    Any ideas/example here on extending existing ABP tables?

  • User Avatar
    0
    arash created

    you can add any memebr to User class in core project , for ecample lets say you want to add mobile number ro user

    you can

    public class User : AbpUser<User> { public const string DefaultPassword = "123qwe";

        public static string CreateRandomPassword()
        {
            return Guid.NewGuid().ToString("N").Truncate(16);
        }
    
        public static User CreateTenantAdminUser(int tenantId, string emailAddress, string password)
        {
            return new User
            {
                TenantId = tenantId,
                UserName = AdminUserName,
                Name = AdminUserName,
                Surname = AdminUserName,
                EmailAddress = emailAddress,
                Password = new PasswordHasher().HashPassword(password)
            };
        }
    
        public long Mobile { get; set; }
    }
    

    }

  • User Avatar
    0
    hikalkan created
    Support Team

    yes, Add them to Users. UserAccounts is just for collecting all users of all tenants in a single table for referencing purposes.