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

Download file via ajax

Hello and welcome 😀, In a previous post we discussed how to create a zip file on demand on the server so that it can be served via Web API. The code for the previous post and this one for can be found in my github repository. So today we're going to look at how … Continue reading Download file via ajax

The rise of the Null-Object pattern in C# 8

Hello and welcome, As I probably mentioned in some of my older posts, I'm a big fan of code restrictions that can be imposed by the IDE. I think this is a reason why stylecop was/is so popular (I don't know since I mostly use Rider nowadays and Resharper for Visual Studio). Because of this, … Continue reading The rise of the Null-Object pattern in C# 8

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

Treating code as data: NDepend

Hello and welcome:), A few weeks back a friend of mine recommended a tool and he described it as such Treating code as data, you can query information about your code and keep track of changes. What he said was an understatement. I tried said tool and I found out that it can become invaluable … Continue reading Treating code as data: NDepend

Automation testing dogma and exploration

Hello and welcome :), In a previous post I hinted about today's topic. So in this post, I want to discuss two topics: Automated tests dogma - this is based on my opinions of things we as developers need to loosen our grip on. Exploratory testing - why and where should we introduce randomness and … Continue reading Automation testing dogma and exploration

Securing Ids on web applications

Hello and welcome 🙂 Recently I have been reading through the documentation and articles about how to protect our web applications from tampering when giving a form to the user. Looking at this, one realizes that the cause for these security measures is due to the inherent nature of HTTP, in that being stateless, we … Continue reading Securing Ids on web applications

Dependency Inversion and Dependency Injection

Hello and welcome, Across the posts, there has been the mention about something called Dependency Inversion or Dependency Injection. In this post, we will take a deeper look at what that actually means and what how it helps us. Dependency Inversion When we talk about dependency inversion we talk about how we structure our projects … Continue reading Dependency Inversion and Dependency Injection

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