Пример #1
0
        public User AddUser(string userName, string password)
        {
            //we should really check if username exists.....
            using (UserDataContext dataContext = new UserDataContext())
            {

                User user = new User();
                user.Salt = PasswordHelper.GenerateSalt();
                user.UserName = userName;
                user.HashPassword = PasswordHelper.HashPassword(password, user.Salt);

                dataContext.Users.InsertOnSubmit(user);

                dataContext.SubmitChanges();

                //user.Id = (int)(decimal)cmd.ExecuteScalar();

                return user;
            }
        }
Пример #2
0
 partial void UpdateUser(User instance);
Пример #3
0
 partial void DeleteUser(User instance);
Пример #4
0
 partial void InsertUser(User instance);