Exemple #1
0
        public bool SetUserStatusPendingDeletion(User user)
        {
            _logService.Info("Setting User: {0} Status to PendingDeletion", user.EntityId);

            _auditRepository.Audit(user, AuditEventTypes.UserSoftDelete, user.EntityId);

            user.Status = UserStatuses.PendingDeletion;
            var deletedUserId = _userWriteRepository.SoftDelete(user);

            _serviceBus.PublishMessage(new CandidateUserUpdate(user.EntityId, CandidateUserUpdateType.Update));
            if (deletedUserId != Guid.Empty)
            {
                _serviceBus.PublishMessage(new CandidateUserUpdate(deletedUserId, CandidateUserUpdateType.Delete));
            }

            _logService.Info("Set User: {0} Status to PendingDeletion", user.EntityId);

            return(true);
        }