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.
Loading...
Related Quiz
- How can you customize the appearance of cells in a DataGrid or DataGridView?
- In ADO.NET, what is an optimistic concurrency model?
- When binding data to a list control, which ADO.NET class is commonly used?
- The CommandType property can be set to ___________ when executing a text-based SQL query.
- When working with non-query commands, what does the ExecuteNonQuery method return as a result?