Trace
Trace
CC#
Created by Trace on 3/13/2023 in #help
❔ Batching
Lets say I have a class like so:
class Item
{
public string Id {get; set;}
public SomeClass Data {get; set;}
}
class Item
{
public string Id {get; set;}
public SomeClass Data {get; set;}
}
I then have a list of thousands of those and need to batch it into chunks of max 100 items (can be less but not more) but such that two items with the same Id do not end up in separate batches (there are max like 10 items with the same ID, so there's not risk of n of items with x Id being higher than the y number of max items in a batch). What would be the most efficient way to do this?
24 replies