↓ Skip to main content

Articles

Red Hat OpenShift

Red Hat OpenShift

·1 min
What is Red Hat OpenShift? OpenShift is Kubernetes, but it is also more than Kubernetes it is a collection of other software services that gives you the ability to run an entire Kubernetes environment, which includes:
Memory Leaks in .NET

Memory Leaks in .NET

·9 mins
On big enterprise projects, memory leaks are like rodents in a factory. You might not notice when there are a few of them, but you always have to be on guard in case they overpopulate, infesting the factory will cause the closer and failure of the factory.
Hosted Background timer task

Hosted Background timer task

·1 min
If you need a background task within .Net Core to be run at set times we can use the Hosted Service provided from the service within .Net Core. A timed background task makes use of the System.Threading.Timer class. The timer triggers the task’s DoWork method. The timer is disabled on StopAsync and disposed when the service container is disposed on Dispose:
Hosting a service inside  ASP.NET Core

Hosting a service inside ASP.NET Core

·1 min
A little hidden gem within .Net Core is the ability to run a Hosted Service inside the application. This allows for your service to run in a different thread to the main application, but keeps everything together though the need to host a separate service.
ILogger in .NET: best practices

ILogger in .NET: best practices

·11 mins
If you are like me you will have been using ILogger in DotNet Core for some time, but you’ll have noticed there are many ways to use the logger, I found this useful article by Rico Suter going over some recommendation and best practices.
Convert an enum to a list

Convert an enum to a list

·2 mins
Here are various was to convert enums to a lists Original posting Get a List of Enum Members The idea is to use Enum.GetValues() method to get an array of the values of the constants in the enum. To get an IEnumerable<T> of all the values in the enum, call Cast<T>() on the array. To get a list, call ToList() after casting.
SQL Record Count

SQL Record Count

·1 min
The fastest way to perform a SQL record count is: DECLARE @TableName sysname SET @TableName = 'Log' SELECT TBL.object_id, TBL.name, SUM(PART.rows) AS rows FROM sys.tables TBL INNER JOIN sys.partitions PART ON TBL.object_id = PART.object_id INNER JOIN sys.indexes IDX ON PART.object_id = IDX.object_id AND PART.index_id = IDX.index_id WHERE TBL.name = @TableName AND IDX.index_id &lt; 2 GROUP BY TBL.object_id, TBL.name;
Unit Test Boilerplate Generator

Unit Test Boilerplate Generator

·1 min
I love this smart template generator, saves so much time and effort. Generates a unit test boilerplate from a given C# class, setting up mocks for all dependencies. Right click an item in Solution Explorer and choose “Create Unit Test Boilerplate” . Supports Visual Studio Test, NUnit, xUnit and many mock frameworks.
Circuit Breaker

Circuit Breaker

·2 mins
As defined by Polly “A circuit breaker detects the level of faults in calls placed through it, and prevents calls when a configurable fault threshold is exceeded”. The circuit breaker only makes sense when calling a less reliable API.
Fault tolerance using Polly

Fault tolerance using Polly

·3 mins
What is a Resilience Framework? Polly is classed as a resilience framework. A resilience framework is a set of libraries that help an application to recover from transient or more extended failures in services or infrastructure upon which it depends. When recovery is not possible, the resilience framework will facilitate graceful degradation of your application.
Throttling/Rate Limiter for an API

Throttling/Rate Limiter for an API

·3 mins
Throttling and rate-limiting allow you to prevent abuse of your API and ensure that your API withstands large numbers of calls (including DoS and accidental loops). With Throttling, you can set a delay on calls after an SLA tier has been exceeded, slowing down the number of requests an API client is making.
ASP.NET Core Guidance

ASP.NET Core Guidance

·11 mins
I came across a very good article on ASP.NET Core which I needed to bookmark, as it gives a clear and understandable guidance on keeping things working as efficiently as possible. https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AspNetCoreGuidance.md Here is a copy of the post
Asynchronous Programming the right way

Asynchronous Programming the right way

·20 mins
There is a right way and a wrong way with programme Asynchronously, mainly due to the initial way Microsoft brought in Async programming was not best practise and they have now made changes to make it more effective and be more productive.
JSON Web Tokens (JWT)

JSON Web Tokens (JWT)

·5 mins
Overview JSON Web Tokens is an emerging standard. They are very close to their standardisation. IETF has taken care of that, and OpenID connect mandates the use of JSON Web token for all of the tokens that are exchanged in that protocol. this article gives you a little look, an overview of the purpose of security tokens, and, and what other types of tokens we have out there and where, where they are used. Then we have a look at the structure of a JSON Web Token, and then we’ll show you how easy it is to create and consume them using the Microsoft DotNet Core development framework.
REST Client / Server API

REST Client / Server API

·1 min
Here is a simple REST Client talking to a stand along Server API all written in DotNet Core 3.1. It is loosely based on creating a simple REST Client, an tutorial from Microsoft can give you the very basic features in DotNet Core https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/console-webapiclient
Health Checks

Health Checks

·2 mins
Using DotNet Core comes some responsibilities, one of those is making sure your application is up and running. Since DotNet Core 2.2 the introductions of health checks have been established. There are two types of Health Checks
Enabling docker remote API on OSX

Enabling docker remote API on OSX

·1 min
Recently I was playing with docker API on OSX to use with Jenkins and the setup was little complicated so I thought to put all steps together in one place. Just to summarise the default tcp port for docker is 2375 (unencrypted) and 2376(encrypted) communication over tcp(although we can choose any other port).