© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
23 replies
Trace

❔ 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
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
n
of items with
x
x
Id
Id
being higher than the
y
y
number of max items in a batch). What would be the most efficient way to do this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Batching actions
C#CC# / help
4y ago
Source Generator AdditionalFiles Batching missing metadata
C#CC# / help
2y ago
Webhook vs queue for updates notifications
C#CC# / help
3mo ago
✅ Updating Migrations
C#CC# / help
3y ago