79162153

Date: 2024-11-06 10:25:39
Score: 1
Natty:
Report link

Have you try to batch your data?

for example:

int batchSize = 1000;
var customers = new List<Customer>();

for (int i = 0; i < ids.Count; i += batchSize)
{
    var batchIds = ids.Skip(i).Take(batchSize).ToList();
    customers.AddRange(dbContext.Customers.Where(c => batchIds.Contains(c.Id)).ToList());
}

or you can make temporary table to store your data and then proceed to your actual table.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Baris Kode ID