Fun C# Code #1 - Infinite Delay (until cancelled)

I came across this code when reading 'Concurrency in C# Cookbook' by Stephen Cleary. Did you know you can have an infinite Task.Delay without loops?

Obviously, there isn't much point in spinning a task that litterally will do nothing. You can use a CancellationToken to cancel the task.

No point. It's just one ... Read more Fun C# Code #1 - Infinite Delay (until cancelled)

How to change time-zone on Ubuntu servers?

Servers US tend to be considerably cheaper in US than in Europe. This has its drawbacks, not least of all, your application will be reporting wired times for various events. However, this is something that can be easily fixed on Ubuntu servers. Our goal is to change date from EST to GMT:

I am ... Read more How to change time-zone on Ubuntu servers?

Maintaining user session on msdeploy in ASP.NET Core (in SQL Server)

Using TeamCity, Bitbucket and msdeploy, I have been able to develop a satisfactory CI process for my web apps. However, I found that whenever an application was deployed to production, the user sessions would expire. Initially, it was not a big issue, but as the number of users grew so did the issue. We want ... Read more Maintaining user session on msdeploy in ASP.NET Core (in SQL Server)

Adding Quartz to your ASP.NET Core

This is a ready made example of how to add a scheduled job to your ASP.NET core web application:

In your Program.cs

How to regain space after dropping columns in SQL Server

I hit an annoying issue today. I wanted to regain space after I dropped several columns in a table. When I run the famous query from StackOverflow:

I got a set of numbers which were the same before and after the removal has

There is, however, a potential issue with this approach if ... Read more How to regain space after dropping columns in SQL Server