예제 #1
0
        public ActionConfirmation SaveOrUpdate(IdentityUser user)
        {
            if (user.IsValid())
            {
                try
                {
                    _userRepository.SaveOrUpdate(user);
                    _userRepository.DbContext.CommitChanges();

                    return(ActionConfirmation.CreateSuccess("user saved"));
                }
                catch (Exception exception)
                {
                    return(ActionConfirmation.CreateFailure("error > " + exception.Message));
                }
            }
            else
            {
                return(ActionConfirmation.CreateFailure("user is not valid"));
            }
        }