0
Sagar Pandurang Kap How to achieve this result without LINQ
0
Hi,
Regarding Grouping Your Messages
Assuming that the numbers you are planning on sending to are housed in a database, you should be able to get a collection of the 1000 numbers that you are planning on sending to and simply grabbing 100 number sections at a time though LINQ :
// Grab your List of numbers to send to
var recipients = ExampleContext.Users.Select(x => x.MobileNumber).ToList();
// Store the batches to process
var batchesToProcess = numbers.Count() / 100;
// Loop through your numbers (100 at a time)
for(int i = 0; i <= batchesToProcess; i++)
{
// Output your first batch (of 100 numbers)
var batch = numbers.Skip(i * 100).Take(100);
// Send to each in this batch
foreach(var number in batch)
{
// Code to send SMS message here
}
// Consider placing a delay between each batch here
Thread.Sleep(6000);
}
Hope it helps...