/// <summary> /// This method handles User insert events by updating the Admin's User list to the latest information. /// </summary> /// <param name="e">UserInserted event.</param> private void HandleUserInsertedEvent(UserInsertedEvent e) { if (_ActorState[e.Id] == null) { UserState cs = e.ResultUserState; UserListItem newUserListItem = UserListItem.GenerateUserListItemFromUserState(cs); // It does not matter if the item exists or not we will stomp for that particular User the existing data // with the new data - see post insert handler. // Persist the event that a new User was added to the User list UserListInsertCommand newCLIC = new UserListInsertCommand(newUserListItem, e.User, e.ConnectionId); _logger.Info($"Inserting new User list item Id:{cs.Id} UserName:{cs.UserName}."); Persist <UserListInsertCommand>(newCLIC, postUserListItemInsertHandler); } }
public bool TranslateAkkaInsertEventToExternalMessage(CommandEventMessage internalCommandEvent) { UserInsertedEvent e = internalCommandEvent as UserInsertedEvent; HTTPExternalInterface.HandleEDStateMessage( new HTTPDestinedCommandStateEvent( MicroServices.ProcessingStatus.Processed, e.Message, new HTTPSourcedCommand( e.CommandType.ToString(), e.Area.ToString(), null, e.ResultUserState, e.User, e.ConnectionId, e.Id ) ), false //User only? ); return(true); }