API Versioning with MVC 6

Updated for ASP.NET Core MVC 1.0.0

Routing has changed a lot in ASP.NET Core MVC 1.0. At first glance it looks pretty much the same as previous versions, using attributes like [Route] and [HttpPost] for defining routes declaratively within a controller. But under the hood it's a complete new implementation that takes care of routing. [...]

RESTful Resource Naming

Yesterday I had an interesting discussion with a colleague of mine about the routes and HTTP verbs we configured for our Web API operations. Being a code purist I liked the idea of having the URIs as RESTful as possible. But many operations of our software just didn't fit in, and it felt quite inconsistent.

The big question: should we hang on to the elegant resource naming of a RESTful API, or go our own way? [...]

Automatically register users locally when authenticating with AzureAD

Using AzureAD as authentication for an ASP.NET application is pretty awesome. I recently had the chance to play with this combination, but found myself figuring out a lot of stuff real soon. This post is about how to set up a relationship between a 'local' user and the AzureAD authenticated identity. [...]

Simplifying querying in a typical ASP.NET n-layer architecture

I've been working on a pretty big project for a couple of months now, and I'm at a point where the current software architecture doesn't scale well enough to fit my needs. With scaling I don't mean performance, but rather the complexity of the source code (which in turn impacts maintainability). Using a very basic form of CQRS I've simplified the query part, which reduces the need for DTO classes and brings querying data to the front of the application. In this post I will explain the steps I've taken and discuss the results. [...]

Auditing properties with EF Code First

So the other day a customer of mine asks whether it's possible to keep track of the 'Status' property on all 'WorkItem' entities. Basically he wanted to know who changed what value and when did that change occur. Auditing is not uncommon among business applications, and it's my safe bet that more properties will be required to keep track of in the future. So better do this the right way from the start then! [...]