Exemplo n.º 1
0
 public void AddTask(TaskItem task)
 {
     using (var context = new RealTimeTasksDataContext(_connectionString))
     {
         context.TaskItems.InsertOnSubmit(task);
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
        public void AddUser(User user, string password)
        {
            string salt         = PasswordHelper.GenerateSalt();
            string passwordHash = PasswordHelper.HashPassword(password, salt);

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