A new way of doing reflection with .NET 8
Explores .NET 8's new UnsafeAccessorAttribute for faster, AOT-friendly reflection, comparing it to traditional methods with benchmarks.
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.
323 articles from this blog
Explores .NET 8's new UnsafeAccessorAttribute for faster, AOT-friendly reflection, comparing it to traditional methods with benchmarks.
A tutorial on building a minimal clone of ASP.NET Core from scratch to understand its core concepts like the web server, controllers, and middleware.
Explains how to create a ChunkedList<T> in C# to avoid Large Object Heap issues when storing massive amounts of data.
Explains the benefits and practical use of C# nullable reference types for safer code and cleaner API design.
Explains the memory leak issue with C# events and demonstrates how to implement the Weak Event pattern using weak references.
Explains the difference between auto-property initializers and expression-bodied getters in C#, showing how each affects property value evaluation.
Explains unexpected behavior of C#'s Enum.TryParse method and provides a solution using Enum.IsDefined for validation.
Explains the advantages of creating custom fakes for unit testing in C#/.NET instead of relying on third-party mocking libraries like Moq.
The Moq library faces controversy for using SponsorLink, a tool that checks for GitHub sponsorships during builds, raising privacy and open-source concerns.
Explains the new Keyed Services feature in .NET 8 Preview 7, showing how to register and inject named dependencies.
Explores combining F# and C# within .NET, highlighting F#'s functional strengths for domain logic and C#'s object-oriented approach.
A guide on using BenchmarkDotNet to compare performance across different .NET versions, with code examples and results.
A guide to using the EntityFramework.Exceptions library to handle specific database errors like constraint violations in Entity Framework.
A developer's guide to migrating a large .NET Framework 4.8 application to .NET 6 using an iterative, step-by-step approach.
Three useful C# programming tips for working with dictionaries, including case-insensitive keys and safe value retrieval methods.
Explains C# overload resolution rules, focusing on implicit conversions and compile-time constant evaluation to determine the best method match.
A developer explains why they prefer xUnit over other .NET testing frameworks, focusing on its test isolation design.
Explains the performance and readability benefits of ordering LINQ queries as Where.Select instead of Select.Where in C#.
Explains why eliding the 'await' keyword in C# async methods results in missing stack trace information, with code examples.
A guide to implementing the Mediator design pattern in C# from scratch, inspired by the MediatR library.