public int InsertUser(string userName, string email, string phone, string zipCode, string region, string password) { DBUser userDB = new DBUser(); UserData userData = new UserData { UserName = userName, Email = email, Phone = phone, ZipCode = zipCode, Region = region, }; UserData userSaltAndHash = LoginController.HashWithIterate(password, userData); //return userData with changed properties (salt and passwordHash). userData.Salt = userSaltAndHash.Salt; userData.PasswordHash = userSaltAndHash.PasswordHash; return(userDB.Create(userData)); }