The C# 9 init-only setters

In a previous post in which we discussed about the Null Object Pattern, we discussed of a hackish approach to make sure that the default properties cannot be changed. Please note that the code snippets from this post have been run in LinqPad so they can be used as is, to run them in Visual … Continue reading The C# 9 init-only setters

Typed claims in ASP.Net Core 2.1

Hello and Welcome 🙂 Today I want to discuss about how we can use claims following a typed approach, this topic came about from a bug that was encountered during a code review for an application. As such I wanted to find a way of mitigating such issues in the future by using concrete classes … Continue reading Typed claims in ASP.Net Core 2.1

Enhancing Asp.Net Core logging pipeline with Serilog

Enhancing Asp.Net Core logging pipeline with Serilog Hello and welcome :), Today I want to show how we can switch out the default logging pipeline in favor of Serilog which has a lot more providers implemented by the community and also provides a way to log structured data. The backstory For those of you who … Continue reading Enhancing Asp.Net Core logging pipeline with Serilog

Getting Closure on Closures

Hello and welcome, It’s been some time since last I wrote, and the reason behind this is because I got caught up in learning more about other languages, particularly Lua, javascript and python, and in this adventure I encountered a repeating topic that I thought is also present in .Net yet not often enough discussed, … Continue reading Getting Closure on Closures

Rolling our own IoC

Hello and welcome 🙂 Previously we talked about what Dependency Inversion and Dependency Injection are, today we’re going to look at what an Inversion of Control (IoC) container is and how it works. In the future, we will also have a look at what are the common implementations of IoCs available and which are my … Continue reading Rolling our own IoC

Performance with IDisposable, outside the box

Hello and welcome, Today I wanted to share with you a technique I used in the past, though by all means not an impressive feat. But first a little story about IDisposable and why I chose this approach. The IDisposable interface is mainly used as a way for the Gargabe Collection to release unmanaged resources, … Continue reading Performance with IDisposable, outside the box

Enums, Flags and Binary Literals

Hello and welcome, Today we're going to look at the enum value types, how they can be composed as flags and how C# 7 makes it easier for us to use and understand. We touched upon enums during the post The hidden side-effect of enums and values. Now we're going to have a more in-depth … Continue reading Enums, Flags and Binary Literals