public void AddToGroup(AddToGroupRequest req) { var customersQueryService = _clientFactory.GetCustomersQueryServiceClient(); var customersAlreadyInGroup = customersQueryService.GetCustomersByGroupId(req.GroupId); var command = new AddCustomersToGroup { GroupId = req.GroupId, CustomerIds = req.Ids.Except(customersAlreadyInGroup.Select(c => c.CustomerId)).ToArray(), }; if (command.CustomerIds.Any()) { var commandService = _clientFactory.GetCommandServiceClient(); commandService.Execute(command); } }
public void AddToGroup(AddToGroupRequest addToGroupRequest) { SendRequest(addToGroupRequest.ToXML()); }