public void AddTask(Task t)
 {
     t.Date        = DateTime.Now.Date;
     t.IsCompleted = false;
     using (var context = new SharedTasksDBDataContext(_connectionString))
     {
         context.Tasks.InsertOnSubmit(t);
         context.SubmitChanges();
     }
 }
        public int AddUser(string firstName, string lastName, string email, string password)
        {
            string salt = GenerateSalt();
            string hash = HashPassword(password, salt);

            using (var context = new SharedTasksDBDataContext(_connectionString))
            {
                User user = new User
                {
                    Email        = email,
                    FirstName    = firstName,
                    LastName     = lastName,
                    PasswordHash = hash,
                    PasswordSalt = salt
                };
                context.Users.InsertOnSubmit(user);
                context.SubmitChanges();
                return(user.Id);
            }
        }