public void Register(RegisterViewModel model, string role) { var hashProvider = new HashProvider(); var passwordHash = hashProvider.HashPassword(model.Password); var user = new User { Username = model.Username, Password = passwordHash.Password, Salt = passwordHash.Salt, Role = role }; int userId = userDAL.CreateUser(user); var gymMember = new GymMember { Name = model.Name, Email = model.Email, WorkoutGoals = model.WorkoutGoals, WorkoutProfile = model.WorkoutProfile, PhotoPath = model.PhotoPath }; userDAL.AddGymMember(gymMember, userId); Session.SetString(SessionKey, model.Username); }