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); }
public async Task <IActionResult> UpdateUserData(UpdateBasUserDto input) { var model = await _userService.UpdateUser(input); return(Json(model)); }