public async Task <LoginDto> Handle(ResetPwdCommand request, CancellationToken cancellationToken) { var UserDetails = await _dbContext.UT_Admin_User .SingleOrDefaultAsync(c => c.pki_user_id == request._loginDto.pki_user_id, cancellationToken); UserDetails.vc_password = _Util.EncryptString(request._loginDto.vc_password).ToString(); await _dbContext.SaveChangesAsync(cancellationToken); return(null); }
public async Task <LoginDto> Handle(UpsertUserCommand request, CancellationToken cancellationToken) { UT_Admin_User entity; if (request._loginDto.pki_user_id > 0 && request._loginDto != null) { entity = await _dbContext.UT_Admin_User .SingleOrDefaultAsync(c => c.pki_user_id == request._loginDto.pki_user_id, cancellationToken); entity.vc_name = request._loginDto.vc_name; entity.vc_email = request._loginDto.vc_email; entity.vc_password = _Util.EncryptString(request._loginDto.vc_password); } else { entity = _mapper.Map <LoginDto, UT_Admin_User>(request._loginDto); _dbContext.UT_Admin_User.Add(entity); } await _dbContext.SaveChangesAsync(cancellationToken); return(request._loginDto); }
public async Task <int> SaveChangesAsync() { return(await _dbContext.SaveChangesAsync()); }