Bird
Raised Fist0

In a LINQ query in C#, what role does the select clause primarily serve?

easy🧠 Conceptual Q1 of Q15
C Sharp (C#) - LINQ Fundamentals
In a LINQ query in C#, what role does the select clause primarily serve?
AIt filters elements based on a condition.
BIt specifies the data to be returned from the query.
CIt sorts the elements in ascending order.
DIt groups elements by a key.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the select clause

    The select clause defines what data the query returns.
  2. Step 2: Differentiate from other clauses

    Filtering is done by where, sorting by orderby, grouping by group by.
  3. Final Answer:

    It specifies the data to be returned from the query. -> Option B
  4. Quick Check:

    select projects the output [OK]
Quick Trick: Select clause defines output projection [OK]
Common Mistakes:
MISTAKES
  • Confusing select with where clause
  • Thinking select filters data
  • Assuming select sorts data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes