An Introduction to Optimising Code Using Span<T> Writing High-Performance C# and .NET Code: Part 3

This post continues my series about writing high-performance C# code. In this post, we’ll continue from the last two posts by introducing the Span<T> type and refactor some existing code by converting it to a Span-based version. We’ll use Benchmark.NET to compare the methods and validate whether our changes have improved the code. If you […]

Read More

HttpClient Creation and Disposal Internals: Should I Dispose of HttpClient? .NET Core Internals - Under the Hood of HttpClient and HttpClientFactory

A common question that I get asked quite often and a point of reasonable confusion for developers is “Should I dispose of HttpClient or not?” There isn’t one yes or no answer to this. It really does depend on a few key factors. In this post, I’ll try to answer this question with enough code snippets […]

Read More

Publishing to AWS Simple Notification Service (SNS) from ASP.NET Core Building distributed systems with .NET Corea and AWS

In this post, I’ll demonstrate how to publish a message to AWS Simple Notification Service from an ASP.NET Core application. The same steps will work just as easily from a .NET Core generic host based console application also. I’ve decided to cover them here as I couldn’t find a specific piece of documentation for this […]

Read More

Using HostBuilder and the Generic Host in .NET Core Microservices Exploring a simple pattern for cross-cutting concerns in console based services.

TL;DR; The “generic” Host and HostBuilder are components  of a new feature set coming with the release of .NET Core 2.1. A use case of them is to simplify the creation of console based services by providing a pattern for adding cross-cutting concerns such as dependency injection, configuration and logging. Introduction Since ASP.NET Core 1.0 […]

Read More