Which LINQ operator is used for grouping elements based on a common attribute or key?

  • GroupBy
  • OrderBy
  • Select
  • Where
The GroupBy operator in LINQ is used to group elements from a data source based on a common attribute or key. It creates groups of elements that share the same value for the specified attribute, allowing for easy aggregation or further analysis of the data. GroupBy is particularly useful when working with datasets that need to be organized into logical groups for processing.
Add your answer
Loading...

Leave a comment

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