/// <summary> /// Add one or more group members to a group. If the main group or any member is unknown it will be created. /// This method is a shortcut for AddMembersToSecurityGroup(...). /// </summary> /// <param name="groupId">Identifier of the container group. Cannot be 0.</param> /// <param name="groupMembers">Collection of the group member identifiers. Can be null or empty.</param> protected void AddGroupsToSecurityGroup(int groupId, IEnumerable <int> groupMembers) { if (groupId == default(int)) { throw new ArgumentException("The groupId cannot be " + default(int)); } if (AllNullOrEmpty(groupMembers)) { return; } var activity = new AddMembersToGroupActivity(groupId, null, groupMembers, null); activity.Execute(this); }