I have arraylist of ids contains 1000 of records and this will be passed to WCF service as parameter and I get response of 1000 records. Now my requirement is to break the 1000 into 10 chunks and call the service 10 times. How can I do this in c# asp.net client?
Example: suppose I have 150 ids to be passed, in this case 100 ids in one function call and 50 should be in second call. Like this if I have 270 ids then 100, 100 and 70 three chunks to be created and three call to be made for the service.
The code I am using right now is pasted below and in this code i am passing all the ids ata a time
ArrayList myArrayList = new ArrayList();
if (parsedData.Count > 0)
{
foreach (var item in parsedData)
{
myArrayList.Add(new Identifier() { Id = item.First() });
}
}
ServiceReference.CustomerProfileServiceClient clientObj = new ServiceReference.CustomerProfileServiceClient();
var responseObj = clientObj.GetProfiles( myArrayList.ToArray(typeof(Identifier)) as Identifier[]);
Thanks