Which LINQ operator is used to group elements in a sequence based on a specified key?

  • GroupBy
  • OrderBy
  • Select
  • Where
The GroupBy operator in LINQ is used to group elements in a sequence based on a specified key. It collects the elements of the sequence into groups based on a key selector function. This is useful for aggregating data or organizing it into meaningful sets based on common characteristics or properties.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *