Skip to main content
100%

Linq exercises I did in .NetFiddle

✓ Published0🌍 Public
Aabonello
Last edited Mar 17, 2026
Created on Mar 17, 2026

This example showcases a series of LINQ (Language Integrated Query) exercises in C# that progressively build from basic filtering to grouping and aggregation. The code, stored as a gist by abonello, defines a TaskItem class with Id, Title, and Completed properties, then demonstrates core LINQ operations including Where for filtering, OrderBy for sorting, Select for projection, Count and Any for aggregation, and FirstOrDefault for element retrieval. The exercises also include GroupBy to summarize completed vs. pending tasks, with each iteration refining the approach—starting with inline ForEach loops, moving to a reusable PrintTasks helper method, and finally exploring concise query syntax with null-conditional operators. The examples show practical patterns for querying in-memory collections, making it useful for developers learning LINQ or preparing for coding interviews.

AI-generated description

Similar vizzes