Containerising the development environment

One of the nice things about docker is that we can use all kinds of software without cluttering up our local machine. I really like the ability to have the development environment running in a container. Here is an example where we: Get a Node.js development environment with all required tools and packages Allow remote […]

Read more
Understanding the LINQ nested grouping example

Here’s an explanation of how the default example for LINQ nested grouping actually works. The usual example for nested grouping looks like this: The objective of this statement is to first group-by students into faculties and then in each faculty create subgroupings of students by their DebtCategory. So how does this actually work and whats […]

Read more
Entity Framework Code First migrations and the [StringLength] annotation

Recently I needed to change my model so that a field would be checked for uniqueness. I eagerly added the [StringLength(3)] and [Index(IsUnique = true)] annotations to the model and ran Add-Migration and Update-Database. Close, but no cigar unfortunately. Update-Database kept throwing the following error: System.Data.SqlClient.SqlException (0x80131904): Column ‘IsoCode’ in table ‘dbo.CurrencyModels’ is of a […]

Read more
Dynamic predicates in C# using PredicateBuilder

One of the challenges I frequently encounter, is having to translate the arbitrary criteria in a testcase to LINQ selection predicates. Take the following very simple example testcase: In this very small example, you already see that the C# code will need to determine at run-time IF an invoice exists AND MAYBE what the contents […]

Read more
Performance of JQXGrid combined with knockout
Knockout.js logo

The other day I noticed poor performance of a JQXGrid when combined with knockout. I had an ko.ObservableArray() with objects. Each object contains only 3 ko.observable(). I was using JQXGrid’s selection check-box on each row. Event-handlers were established to react to changes in the check-box and set one of the ko.observable() in the the corresponding […]

Read more
How to see the real-time state of your view-model

When testing and debugging your web-application, its convenient to see the real-time state of the view-model. This is very easy when you’re using a data-binding framework such as knockout. You can simply bind the JSON representation of the view-model to some visible DOM element, like this: Sometimes, the objects in your view-model might have circular […]

Read more
Entity Framework: How to delete your old database and start fresh with a new one

In a previous post I explained how to recover after deleting a Entity Framework database. In this post we’ll see the proper way to recreate the database in Entity Framework: Careful before you start, make sure you’ve got source-control or back-ups of the code in the Migrations folder. When you delete the Migrations folder, you’re […]

Read more