Secure an ASP.NET Core api with Firebase

August 22, 2017 · asp.net-core security firebase

Introduction Update: Updated the code samples according to the changes introduced in .NET 2.0. Firebase is an application development framework and infrastructure provided by Google. It offers a handful of services, like Storage, Analytics, Notifications and Hosting, mainly targeted »

Troubleshooting high memory usage with ASP.NET Core on Kubernetes

August 17, 2017 · kubernetes .net-core asp.net-core

At work we are running several ASP.NET Core APIs on the hosted version of Kubernetes in the Google Cloud (GCE—Google Container Engine). In almost all of our components we noticed that they had unreasonably high memory usage. The »

Running ASP.NET Core in auto-scaling containers? Warm up!

July 29, 2017 · asp.net-core web api kubernetes

ASP.NET Core APIs are not warmed up by default. This is easy to illustrate, let's scaffold a brand new empty api. mkdir warmuptest cd warmuptest dotnet new webapi dotnet restore dotnet run Then let's do two consecutive requests against »

Tear down your ASP.NET Core api between integration tests

June 21, 2017 · c# asp.net-core integration-testing testing couchbase quartz.net

The way to write integration tests for ASP.NET applications has been made much easier with the advent of ASP.NET Core. This is mainly due to the programming model becoming super modular, which means that it is really easy »

Setting up Coveralls with OpenCover for a .NET Core project

June 14, 2017 · appveyor testing opencover coveralls .net-core

Update: The original version of this post was written when the dotnet toolchain was built on top of the project.json based project structure. Since then the project.json was deprecated, and .NET Core moved to a csproj-based approach. Because »

A data model exercise in two languages, part 2: F#

May 22, 2017 · f# computer science c#

Introduction In the previous post I took a look at a data modelling exercise in C#, I designed a data model to represent a card in the standard 52-card deck. We saw some of the problems we face when designing »

A data model exercise in two languages, part 1: C#

May 4, 2017 · c# f# computer science

Introduction When I'm learning a new programming language, I usually like to do some coding exercises to get familiar with the various language features, and to get used to the syntax. Many of these exercises—or katas—are about implementing »

Playing with the composition of the Kleisli category in C#

April 19, 2017 · c# f# category-theory

Introduction Recently I learnt about an interesting concept in category theory called a Kleisli category. Let's look at a concrete example I took from this blog post (in his series about category theory) by Bartosz Milewski. We would like to »

Two gotchas with scoped and singleton dependencies in ASP.NET Core

April 17, 2017 · asp.net-core c# dependency-injection

With ASP.NET Core a new built-in lightweight Dependency Injection framework was introduced in the Microsoft.Extensions.DependencyInjection package, thus in ASP.NET Core applications we don't necessarily need an external library such as Ninject or Unity to do DI, »

Bulk updating document expiry in Couchbase

March 25, 2017 · couchbase

Introduction When using Couchbase, sometimes we want to update the expiry of all of the documents stored in a bucket. In my case it was in a project where initially we weren't sure how we want to handle document expiry »