Pattern matching and the compiler can be surprising
Explores a surprising C# compiler warning when using pattern matching with nullable properties, revealing edge cases in static analysis.
Steven Giesel is a Senior Software Engineer and Microsoft MVP with over 13 years of experience, specializing in .NET and modern backend development. He shares deep technical knowledge across topics such as C#, EF Core, RavenDB, distributed systems, and cloud-native architectures, and is an active speaker in the .NET community.
314 articles from this blog
Explores a surprising C# compiler warning when using pattern matching with nullable properties, revealing edge cases in static analysis.
C# 13 may allow the use of 'ref' and 'unsafe' in iterators and async methods, addressing current limitations with references and spans.
Introducing NCronJob, a lightweight .NET job scheduler library that sits between BackgroundService and full-featured schedulers like Hangfire.
Overview of bUnit v2, a major update to the Blazor unit testing library, covering new features, breaking changes, and API refinements.
Explains how to use xUnit's TheoryData<T> for type-safe parameterized tests in C#, replacing untyped IEnumerable<object[]> data.
Explores new lock statement patterns in .NET 9, comparing the new Lock class with traditional Monitor-based locking and showing performance benchmarks.
Explains why using multiple boolean parameters in functions is problematic and demonstrates cleaner refactoring techniques.
An updated visual mind map of LINQ features and operations, now including all additions up to .NET 9.
A simplified infographic explaining how the .NET Garbage Collector works, with links to more detailed technical articles.
Explores new .NET 9 enhancements to the SearchValues object, enabling efficient string searches alongside character lookups.
Explores three new LINQ methods added in .NET 9: CountBy, AggregateBy, and Index, with code examples.
Explores alternatives to the deprecated BinaryFormatter in .NET 8, focusing on JSON and MessagePack for object serialization.
A critique of AutoMapper for C# object mapping, advocating for compile-time source generators like Mapperly as a simpler, more maintainable alternative.
Explores how const strings in C# can be modified using unsafe code and string interning, despite being compile-time constants.
A technical guide on implementing a lock-free ring buffer in C# for asynchronous logging, explaining its benefits and providing sample code.
Introduces the new System.Threading.Lock type in .NET 9, a dedicated lock type that aims to be more explicit and potentially faster than using a plain object with the lock keyword.
Explores the potential new 'params collections' feature in C# 13, allowing the params keyword to be used with collection types beyond arrays.
Introduces bUnit Generators, a tool for automatically creating stubs for third-party components in Blazor unit tests.
Explains how to store complex objects and lists as JSON in databases using Entity Framework 8 and 7, including configuration and benefits.
Explores creating a .NET 8 interceptor for bUnit to auto-generate stubs for Blazor components, improving unit testing.