Example #1
0
        private void PostUserListDeleteHandler(UserListDeleteCommand c)
        {
            _logger.Info($"Deleted User list item Id{c.Id} UserName:{c.UserListItemData.UserName}.");
            _ActorState[c.UserId] = c.UserListItemData;
            UserListItemDeletedEvent message = new UserListItemDeletedEvent(c.UserListItemData.Copy(), c.User, c.ConnectionId);

            NotifySubscribers(message);
            AutoSaveSnashot(false);
        }
Example #2
0
        /// <summary>
        /// Removes User(item) from the list.  If an instance of the UserActor is in memory it unloads it.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private void HandleUserDeletedEvent(UserDeletedEvent e)
        {
            // Is the item still in the list?
            if (_ActorState[e.Id] == null)
            {
                _logger.Info($"{e.User} tried deleting from User list id:{e.Id} but was not found.");
            }
            else
            {
                UserListItem cliNewState = _ActorState[e.Id].Copy();
                cliNewState.IsActive = false;

                // Memorialize that we are removing the item from the list in the journal
                UserListDeleteCommand UserListDeleteCommand = new UserListDeleteCommand(
                    cliNewState,
                    e.User,
                    e.ConnectionId);

                _logger.Info($"Deleting User list item Id{e.Id} UserName:{e.ResultUserState.UserName}.");
                Persist <UserListDeleteCommand>(UserListDeleteCommand, PostUserListDeleteHandler);
            }
        }
Example #3
0
 private void DeleteUserListRecoveryCommand(UserListDeleteCommand c)
 {
     _logger.Info($"Recovery Deleting User list item Id{c.Id} UserName:{c.UserListItemData.UserName}.");
     _ActorState[c.UserId] = c.UserListItemData;
     _logger.Info($"Recovery Deleted User list item Id{c.Id} UserName:{c.UserListItemData.UserName}.");
 }