Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
137 posts found
Why Async Exists in C#: Blocking, I/O and Scale
Backend PART 01

Why Async Exists in C#: Blocking, I/O and Scale

The same 100 stock queries finish in one second with async and in 8-9 seconds with code that blocks the thread. The difference between I/O-bound and CPU-bound work, what blocking costs in a UI and on a server, thread pool starvation, why async buys capacity rather than speed, and the fake async trap.

7 Nov 2026 9 min 12
LINQ and .NET 10: LeftJoin, RightJoin, Shuffle, Sequence and Async LINQ
Backend PART 17

LINQ and .NET 10: LeftJoin, RightJoin, Shuffle, Sequence and Async LINQ

LINQ in .NET 10: LeftJoin and RightJoin replacing the GroupJoin and DefaultIfEmpty pattern, the deferred Shuffle, Sequence and InfiniteSequence built on generic math, System.Linq.AsyncEnumerable in the BCL and the CS0121 clash with the System.Linq.Async package; a short look at FullJoin coming in .NET 11.

7 Nov 2026 10 min 9
LINQ and .NET 9: CountBy, AggregateBy and Index
Backend PART 16

LINQ and .NET 9: CountBy, AggregateBy and Index

LINQ in .NET 9: CountBy, which returns a sequence rather than a dictionary, AggregateBy for per-key accumulation and a BenchmarkDotNet measurement of their memory advantage over GroupBy, Index() instead of Select((x, i) => ...), the Queryable counterparts and the mutable seed trap.

7 Nov 2026 11 min 6
LINQ and .NET 7–8: Order, ToDictionary Without Selectors and Performance
Backend PART 15

LINQ and .NET 7–8: Order, ToDictionary Without Selectors and Performance

.NET 7's Order and OrderDescending, which need no key selector, why a missing IComparable only blows up at runtime, culture-sensitive versus ordinal string sorting, .NET 8's selector-less ToDictionary, and vectorized Max/Sum plus Order versus OrderBy(x => x) measured with BenchmarkDotNet.

7 Nov 2026 10 min 7
LINQ with Real Data: Scenarios on Orders Read from a JSON File
Backend PART 14

LINQ with Real Data: Scenarios on Orders Read from a JSON File

LINQ over orders read from a file with System.Text.Json: the casing trap and JsonSerializerDefaults.Web, validating the data (duplicates, unknown customers, bad quantities), monthly revenue, best sellers, a customer report with GroupJoin, writing JSON back and streaming with DeserializeAsyncEnumerable.

7 Nov 2026 12 min 5
LINQ Performance: Multiple Enumeration, Materializing and Measuring with BenchmarkDotNet
Backend PART 13

LINQ Performance: Multiple Enumeration, Materializing and Measuring with BenchmarkDotNet

How many times the same query runs without you noticing, when ToList saves you and when it hurts, Any() instead of Count() > 0 and TryGetNonEnumeratedCount; measuring with BenchmarkDotNet 0.15.8 why a Where inside a loop is 50x slower than a lookup, and comparing loops with LINQ on a noisy machine, with real numbers.

7 Nov 2026 13 min 8
Writing Your Own LINQ Operator: Extension Methods and yield return
Backend PART 12

Writing Your Own LINQ Operator: Extension Methods and yield return

Why a LINQ operator is just an extension method; writing lazy, streaming operators with yield return, separating argument validation from the iterator, immediate operators, finally when enumeration is abandoned early, an Expression-based operator for IQueryable and name clashes with the BCL.

7 Nov 2026 13 min 7
LINQ Any, All, Contains, SequenceEqual and the Conversion Operators
Backend PART 11

LINQ Any, All, Contains, SequenceEqual and the Conversion Operators

Why All returns true on an empty sequence and why validation needs Any as well, how Any stops at the first element versus Count() > 0, Contains and record equality, SequenceEqual and the trap of records carrying collections, snapshots with ToList/ToArray/ToHashSet, duplicate keys in ToDictionary, and the difference between Cast and OfType.

7 Nov 2026 10 min 8
LINQ Join and GroupJoin: Inner Join, Composite Keys and the Left Join Pattern
Backend PART 10

LINQ Join and GroupJoin: Inner Join, Composite Keys and the Left Join Pattern

How Join, as an inner join, drops unmatched rows and multiplies multiple matches, and its documented order. The direction of equals in query syntax and CS1937/CS1938, composite keys and CS1941, hierarchical results with GroupJoin, the left join pattern with GroupJoin + DefaultIfEmpty and its null trap, multiple joins, and how Join runs in n + m with a lookup.

7 Nov 2026 11 min 8
LINQ Set Operations: Distinct, Union, Intersect, Except and DistinctBy
Backend PART 09

LINQ Set Operations: Distinct, Union, Intersect, Except and DistinctBy

Where Distinct gets its equality from and why it removes nothing on a class without equality. How Union, Intersect and Except deduplicate the result, how they differ from Concat and Where, the documented order, comparing with a comparer, .NET 6 DistinctBy/UnionBy and IntersectBy/ExceptBy taking a list of keys, the CS0411 error, HashSet and deferred execution.

7 Nov 2026 9 min 8
LINQ Grouping: GroupBy, IGrouping and ToLookup
Backend PART 08

LINQ Grouping: GroupBy, IGrouping and ToLookup

How GroupBy runs deferred and ToLookup immediately, and what that does to the result. The key and elements of IGrouping, the documented group order, grouping and summarizing, the element and result selector overloads, group by into in query syntax, composite keys, how ToLookup handles a missing key, grouping with a comparer, and how GroupBy buffers its source.

7 Nov 2026 10 min 8
LINQ Aggregation Operators: Count, Sum, Average, Min, Max, Aggregate and MinBy/MaxBy
Backend PART 07

LINQ Aggregation Operators: Count, Sum, Average, Min, Max, Aggregate and MinBy/MaxBy

Why Sum returns 0 and Max throws on an empty sequence, and the nullable selector and DefaultIfEmpty fixes. Count and .NET 6 TryGetNonEnumeratedCount, the return type of Average, the checked overflow of Sum, MinBy/MaxBy returning the element instead of the value, the three overloads of Aggregate, and how many times you enumerate the same query.

7 Nov 2026 11 min 9
Blog Map