示例#1
0
        public async Task <ReturnValueModel> UpdateUser(UpdateBasUserDto input)
        {
            string           strMessage = string.Empty;
            bool             IfSuccess  = true;
            ReturnValueModel model      = new ReturnValueModel();

            try
            {
                var user = _mapper.Map <BasUser>(input);
                user.PassWord = (await _repository.QueryNoTracking(x => x.UserName == user.UserName).FirstOrDefaultAsync()).PassWord;
                await _repository.UpdateAsync(user);

                await _unitOfWork.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                IfSuccess  = false;
                strMessage = ex.Message;
            }
            model.IfSuccess = IfSuccess;
            model.Message   = strMessage;
            return(model);
        }
示例#2
0
        public async Task <IActionResult> UpdateUserData(UpdateBasUserDto input)
        {
            var model = await _userService.UpdateUser(input);

            return(Json(model));
        }