Esempio n. 1
0
        public ChangePasswordResult Post(ChangePasswordSpecification spec)
        {
            if (spec == null)
            {
                throw new ArgumentNullException(nameof(spec));
            }

            var request = mapper.Map <PasswordChangeRequest>(spec);
            var result  = passwordChanger.Value.ChangeOwnPassword(request);

            return(mapper.Map <ChangePasswordResult>(result));
        }
Esempio n. 2
0
        public ActionResult Change(ChangePasswordSpecification spec)
        {
            if (spec == null)
            {
                throw new ArgumentNullException(nameof(spec));
            }

            var request   = mapper.Map <PasswordChangeRequest>(spec);
            var result    = passwordChanger.Value.ChangeOwnPassword(request);
            var webResult = mapper.Map <ChangePasswordResult>(result);

            TempData.Clear();

            TempData.Add(ResultKey, webResult);
            return(RedirectToAction(nameof(Index)));
        }