Keyed Services in the IServiceProvider in .NET 8 preview 7
Explains the new Keyed Services feature in .NET 8 Preview 7, showing how to register and inject named dependencies.
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
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.
Explains C# 12's new collection literals feature, a concise syntax for creating and merging collections and dictionaries.
Explains the internal workings of the .NET List<T> class, focusing on its dynamic array implementation, resizing behavior, and performance considerations.
Explains the differences and use cases for Span<T>, Memory<T>, and ReadOnlySequence<T> in C# for high-performance memory access.
Explains the new TimeProvider abstraction in .NET 8 for mocking and controlling time in tests, making time-dependent code easier to test.
Introduces the new terminal logger in .NET 8 Preview 4, highlighting its cleaner, colored output and how to use it.
Explains the new enhancement to the C# 12 `nameof` operator, allowing access to instance members from a static context.
Explains how .NET 6's TryGetNonEnumeratedCount method works to get an element count without enumeration, using internal interfaces like IIListProvider.
A guide to six practical C# extension methods for IEnumerable, including IsNullOrEmpty, Partition, Median, and Mode.
Explores practical uses of C# ValueTuple for swapping values, pattern matching, deconstruction, and implementing IEquatable to write cleaner code.