コード例 #1
0
ファイル: CommandsController.cs プロジェクト: Dnigor/mycnew
        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);
            }
        }
コード例 #2
0
 public void AddToGroup(AddToGroupRequest addToGroupRequest)
 {
     SendRequest(addToGroupRequest.ToXML());
 }