Esempio n. 1
0
        public string SaveItem([FromBody] BucketListItem changedItem)
        {
            var item = _context.Items.Single(x => x.ID == changedItem.ID);

            _context.Entry(item).CurrentValues.SetValues(changedItem);
            _context.Entry(item).State = System.Data.Entity.EntityState.Modified;
            _context.SaveChanges();
            return("Item " + item.ID + " has been saved!");
        }
        public ActionResult ResetPassword(ChangePasswordInfo info)
        {
            var    user        = _context.Users.SingleOrDefault(x => x.ID == guid);
            var    userChanges = user;
            string hash        = SecurePasswordHasher.Hash(info.Password);

            userChanges.PasswordHash = hash;
            _context.Entry(user).CurrentValues.SetValues(userChanges);
            _context.Entry(user).State = System.Data.Entity.EntityState.Modified;
            _context.SaveChanges();
            return(View("PasswordChanged"));
        }