Mime Type Helper in .NET 11
Introduces the new MediaTypeMap helper in .NET 11 for easy MIME type and file extension lookups in web development.
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
Introduces the new MediaTypeMap helper in .NET 11 for easy MIME type and file extension lookups in web development.
How to implement sortable UUID v7 GUIDs as primary keys in Entity Framework using a custom value generator.
Explains that .NET 10 makes the Program class public by default, eliminating the need for 'public partial class Program' declarations in WebApplicationFactory tests.
Explains how to capture console output in xUnit.v3 tests using the new CaptureConsoleAttribute assembly-level attribute.
Analyzes common flaws in C# ArrayPool benchmarks, explaining how JIT optimizations can invalidate results and how to fix them.
Analyzes a LinkedIn post's claim about C# Random() being 'evil', explaining its evolution from .NET Framework to modern .NET's Xoshiro256** implementation.
Explores how inlining and structs in C# interact to optimize performance, focusing on method call overhead and struct copying.
Explains why and how to use CancellationTokens in .NET APIs to stop long-running operations and free server resources.
Analyzes C# performance benchmarks for slicing lists, comparing Skip/Take, Range operator, and GetRange methods, highlighting a common benchmarking error.
Explains how ToDictionaryAsync in Entity Framework Core retrieves entire database objects, impacting performance, and provides a solution using Select.
A developer shares techniques to improve database performance for large BLOB data retrieval in C#/.NET, including compression and chunking requests.
Explains the performance difference between C# collection expressions and collection initializers, showing how expressions preallocate lists.
Explores two new LINQ extension methods, InfiniteSequence and Sequence, introduced in .NET 10 Preview 6, highlighting their usage and generic math support.
Explains how to bypass Entity Framework's SqlRaw requirement to return all entity properties by explicitly selecting NULL for missing columns.
Explains how to disable thread safety checks in Entity Framework for performance, with warnings about risks and proper usage.
A guide to using architectural unit tests in C#/.NET to enforce CancellationToken usage and sealed classes in controllers.
Explains why C# List foreach loops don't lower to array-style while loops, focusing on version safety and performance semantics.
An update on the performance fix for ToListAsync in Entity Framework Core, addressing slow queries and high allocations when fetching large data.
Explains how to add descriptive names to data-driven test cases in xUnit by overriding the ToString() method in test data records.
Explains a specific edge case where switch expressions fail in Blazor due to parsing conflicts with HTML/razor syntax.