Automated, portable code style checking in .NET Core projects

July 8, 2018 · .net-core c# linting

A quick introduction to setting up automated code style checking for .NET Core projects with StyleCopAnalyzers and editorconfig. »

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 »

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, »

How to validate action parameters with DataAnnotation attributes?

February 28, 2016 · asp.net c# .net-core asp.net-core

Model validation in MVC In both MVC and Web Api we can use the attributes provided in the System.ComponentModel.DataAnnotations namespace to specify validation rules for our models. Let's say we have a controller action with the following signature, »

ASP.NET Core 1.0: hints to get started

February 14, 2016 · asp.net c# .net .net-core asp.net-core dnx

I recently started working on implementing a Web Api application using ASP.NET Core 1.0, running it on Linux with the CoreCLR. There have been many changes introduced in this new version of ASP.NET, and there are also »

Simple client-side compression for Couchbase - with benchmarks

January 16, 2016 · c# .net couchbase

Introduction In the last post I described the quirks and problems I encountered during getting started with using Couchbase Server in a production environment. When we are storing complex objects, by default the .NET Couchbase SDK uses Json.NET serialization. »

Couchbase Server: tips for troubleshooting issues

January 10, 2016 · c# .net couchbase

Recently at work we started using Couchbase Server to replace a rather outdated caching solution in our architecture. This was the first time I had to use Couchbase and its .NET SDK, and I have encountered a couple of issues »