Steve Talks Code
Coding thoughts about .NET
Posts relating to .NET Core
Understanding Disposables In .NET Dependency Injection - Part 2
17 Nov 2020
Following on from Part 1 where I provide an overview of hiding the Dispose method from consumers of the Dependency Injection container, in this part, I move on to dealing with objects that are created outside, but registered with the DI container.
Understanding Disposables In .NET Dependency Injection - Part 1
17 Nov 2020
In this post I will be discussing the traps that can catch you out by potentially creating memory leaks when registering types that implement the IDisposable interface as services with the out-of-the-box .NET Dependency Injection container.
Should I be Checking Injected Dependencies for Null?
20 Dec 2020
In this post, I present my Top 5 scenarios of null injections from the .NET Dependency Injection container and use these to justify adding guard clauses to your C# constructors in consuming classes.
Introducing Strongly Typed HTTP Request Headers for ASP.NET Core
12 Jan 2021
In this first part of a series of posts, I discuss the thinking behind taking string based HTTP Headers and presenting them to your .NET code via dependency injection as strongly typed objects.
Styles of Writing ASP.NET Core Middleware
6 Feb 2021
In this post, I discuss the differences between convention and factory styles of writing middleware in ASP.NET Core along with the differences in how the instances are created and interact with dependency injection.
Using OpenApiReference To Generate Open API Client Code
15 Mar 2021
I this post I show how you can customise the code generated by the OpenApiReference tooling from Visual Studio's Connected Services using NSwag commands.
Share this post
Recent Blog Posts
Source Generated RegEx in .NET 7
Creating a ZX Spectrum Image Load Video
Could .NET Source Generator Attacks Be A Danger To Your Code?
Debugging C# Source Generators with Visual Studio 2019 16.10
Latest on Twitter
No results found
.NET 7 (1)
.NET Core (16)
ASP.NET Core (17)
C# 9 (5)
Clean Code (10)
Code Generation (3)
Continuous Integration and Deployments (1)
Dependency Injection (8)
Design Patterns (13)
Dev Ops (2)
Octopus Deploy (1)
Retro Computing (1)
Visual Studio (2)