Exemple #1
0
 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, "");
 }
Exemple #2
0
 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);
     }
 }