Web API in MVC 6

With ASP.NET Core MVC 1.0, the MVC and Web API framework have been merged into one framework called MVC. This is a good thing, since MVC and Web API share a lot of functionality, yet there always were subtle differences and code duplication.

Read More

Async tips and tricks

The async and await keywords along with the Task and Task<T> classes provide a great way to do asynchronous work in C#. However, there might be some confusion when to mark a method as async, when to await a task and when to use the Task class. In this post I will try to clear some things up using some simple examples.

Read More

ASP.NET MVC drop down list for enums

From time to time I use enums in my domain models. Entity Framework has a nice integration and they’re a lot better than hard-coded strings or meaningless numbers. But when it comes to creating insert and update forms for the entity, it might be a hassle use enums in your view. In this post I will explain how to create a stronly typed HtmlHelper extension method to create a drop down list with enum values.

Read More