61. What is LINQ?
Language Integrated Query for querying collections and databases.
62. Syntax types?
- Query syntax: SQL-like
- Method syntax: extension methods (Where, Select)
63. What is deferred execution?
Query isn’t executed until results are enumerated.
64. Difference between IEnumerable and IQueryable in LINQ?
- IEnumerable: LINQ to Objects, executed in memory
- IQueryable: LINQ to database, executed on server
65. What is the difference between Select and SelectMany?
SelectMany flattens nested collections.
66. What is the difference between First, FirstOrDefault, Single, SingleOrDefault?
- First: first element, throws if none
- FirstOrDefault: returns default if none
- Single: exactly one element, throws otherwise
- SingleOrDefault: returns default if none, throws if >1
67. What is LINQ to SQL?
Maps LINQ queries to SQL database tables.
68. What is a projection in LINQ?
Transforming data, usually with Select.
69. What is filtering in LINQ?
Using Where to select items based on condition.
70. What is ordering in LINQ?
Using OrderBy, OrderByDescending to sort results.