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
Creating zips server side per request
Hello and welcome 😀, Today's post will focus on a situation I encountered recently, and that is How to create a zip archive on demand to be served via an API endpoint. In a following post, we will see how to receive a file from an AJAX call since there's some trickery involved there as … Continue reading Creating zips server side per request
Mocking LINQ Expressions
Hello and welcome In today's post, we will discuss mocking/stubbing lambda expressions so that we can have a bit more control over our unit tests. Keep in mind that I'm by no means versed in expression trees so I will try my best to explain. What is an Expression and how to use it Going … Continue reading Mocking LINQ Expressions
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
Online scams and what to watch out for
Hello and welcome 🙂 Today I wanted to discuss something that I encountered recently with (possible) online scammers and I wanted to give you some tricks and tips as to how to avoid or at least be wary of them. The reason I mentioned "possible" is that I caught it early and as such the … Continue reading Online scams and what to watch out for
Mouse automation with AutoItX
Hello and welcome, In this post, we are going to talk about how we can automate part of the windows desktop environment using AutoItX. What is AutoItX? Before we can talk about AutoItX first we need to talk a little bit about AutoIt. AutoIt as we see from the description on their page and their … Continue reading Mouse automation with AutoItX
LiteDb Review
Hello and welcome, When it comes to databases we have quite a few to select from though most of them either fall under the SQL or NoSQL categories, though we can further break it down into databases that run on a server and databases that can be embedded into our applications. For the development environment, … Continue reading LiteDb Review
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
Application triggers for Asp.Net Core 2.1 entity framework core
Hello and welcome 🙂 Today I wanted to talk about extending your application and your DbContext to run arbitrary code when a save occurs. The backstory While working with quite a few applications that work with databases especially using entity framework, I noticed the pattern of saving changes to the database and then do something … Continue reading Application triggers for Asp.Net Core 2.1 entity framework core