public void GenerateAndUpdatePassword(Earthwatcher earthwatcher) { var prefix = PasswordChecker.GeneratePrefix(); var hashedPassword = PasswordChecker.GenerateHashedPassword(earthwatcher.Password, prefix); // store in database var connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["EarthwatchersConnection"].ConnectionString; var repos = new EarthwatcherRepository(connectionstring); repos.UpdatePassword(earthwatcher, prefix, hashedPassword); }