Rico Suter's blog.
 

Articles

Getting started with Entity Framework Code First Migrations

The following post describes the steps to setup and use Entity Framework Code First Migrations. For more information read this Microsoft page. The sample application shown in this article can be found on GitHub.
Read More ›

How to implement an enum with string values in TypeScript

I currently work an a single-page application (SPA), where we use TypeScript to access web services. In some places, the sent and received data structures use enums to describe the range of allowed values.
Read More ›

Bug Fix: Code Contracts compile error in Visual Studio 2015 and Windows 10

This article shows how to fix Code Contracts compile errors in Visual Studio 2015 and Windows 10.
Read More ›

Avoiding DLL file locks when using .NET reflection in external assemblies

For one of my projects, I had to load external assemblies and query the exported types (i.e. the public classes) using reflection. Everything worked fine, except that the .DLL files were being locked until the application was terminated.
Read More ›

Precompile ASP.NET MVC Razor views in Release mode to find errors at compile time

A problem we often face when developing ASP.NET MVC applications is that errors in Razor views are only detected at runtime while browsing the site. This is because the Razor views are not compiled until they are requested by the browser.
Read More ›

Post-process the HTML output of an action in ASP.NET MVC

This article shows how to implement a post-processor for an ASP.NET MVC application, which transforms the output of an controller action before it is transmitted to the client. The obvious way to do this is by implementing a custom action filter. First, we implement the base filter class:
Read More ›

Manually triggered computed observables in KnockoutJS

In KnockoutJS I sometimes need to create a computed observable which does not automatically detect the dependencies and which has to be triggered manually. This may be required if the computation is very complex and should only run in certain situations.
Read More ›

ASP.NET MVC: How to implement an edit form for an entity with a sortable child collection

This article shows how to implement the edit form for an entity with a collection property. As a show case, we will implement the edit form for a person entity with multiple addresses. The following diagram shows the UML diagram of the two entity classes:
Read More ›

My most used Visual Studio and ReSharper extensions

This article describes some of the Visual Studio and ReSharper extensions and development tools I’m using to enhance my daily C#/.NET development productivity.
Read More ›

Cheat Sheet: Best practices for writing XML documentation in C#

The XML documentation tags of C# are described very well in the MSDN. However, the article does not explain how the contained phrases and sentences should be written. This article tries to fill this gap by providing rules and some sample phrases.
Read More ›