Exemplo n.º 1
0
 public void AddUrl(URL url)
 {
     using (var context = new UserUrlDataContext(_connectionString))
     {
         context.URLs.InsertOnSubmit(url);
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
        public void RegisterUser(User user, string password)
        {
            string passwordSalt = PasswordHelper.GenerateSalt();
            string passwordHash = PasswordHelper.HashPassword(password, passwordSalt);

            user.PasswordSalt = passwordSalt;
            user.PasswordHash = passwordHash;
            using (var context = new UserUrlDataContext(_connectionString))
            {
                context.Users.InsertOnSubmit(user);
                context.SubmitChanges();
            }
        }