private static void RegisterUser() { var repo = new UserRepository(); var username = ConfigurationManager.AppSettings["user"]; var user = repo.GetUser(username); if (null != user) return; var password = ConfigurationManager.AppSettings["password"]; repo.CreateUser(username, password, ""); }
private static void RegisterUser() { var repo = new UserRepository(); var username = ConfigurationManager.AppSettings["user"]; var user = repo.GetUser(username); if (null != user) return; var hashedPassword = ConfigurationManager.AppSettings["hashedPassword"]; if (!string.IsNullOrEmpty(hashedPassword)) { repo.CreateUserWithHashedPassword(username, hashedPassword); } else { var password = ConfigurationManager.AppSettings["password"]; repo.CreateUser(username, password); } }