Exemple #1
0
        private static ICommand CreateCommandToUpdateMembership(int teamId, string idOfUserToUpdate,
                                                                UserMembershipStatus newMembershipStatus)
        {
            ICommand command = null;

            if (newMembershipStatus == UserMembershipStatus.Removed)
            {
                command = new RemoveUserFromTeamCommand(idOfUserToUpdate, teamId);
            }
            else
            {
                command = new UpdateMembershipStatusCommand(idOfUserToUpdate, teamId,
                                                            Mapper.Map <UserMembershipStatus, MembershipStatus>(
                                                                newMembershipStatus));
            }
            return(command);
        }
Exemple #2
0
 public async Task <Unit> RemoveUserFromTeam([FromRoute] int teamId,
                                             [FromBody] RemoveUserFromTeamCommand command)
 {
     return(await _mediator.Send(command));
 }