public IHttpActionResult AddGroupMember(Guid groupId, NewGroupMember newGroupMember) { if (groupId == Guid.Empty) { throw new ArgumentException("groupId must be defined."); } if (newGroupMember == null) { throw new ArgumentNullException("newGroupMember"); } if (newGroupMember.UserId == Guid.Empty) { throw new ArgumentException("User id must be defined."); } var groupMember = identityManagementService.AddGroupMember(groupId, newGroupMember.UserId); UserListItem userListItem = mapperFactory.CreateUserListItemMapper().Map(groupMember); return(Ok(userListItem)); }